hi everyone in this lecture we will see how to create a new database to create a new database do not have to use any new command you can just use SQLite 3 followed by the database name I will create a database called test dot DB so make sure to give the extension dot DB so if you see tester DB database created but on the command prompt we cannot see anything or any confirmation that our database is created so to check whether the database is created or not you can go to databases as you can check by using dot databases and if you see I have one database and the file location is this is my current file location test dot TV and at any moment if you want to quit this SQLite you can use dot quit this is one way you can also use control for and B you can use ctrl + D so I am inside SQLite folder if you see the database is already created with the name test dot DV and we can also use dot dump to export the complete database in the form of text file so that is sqlite3 and followed by the database name that is test dot DB and dump and the file name the file name would be anything something like test dot SQL if you see I have the database and I have a file and I copied the data I copied the complete database by using dot dump command in this lecture we will see how to attach a database consider scenario when you have multiple databases available and you want to use any one of them it in at a time so SQL so SQLite attach database statement is used to select a particular database and after this command all SQLite statements will be executed under the attached database the basic syntax of SQLite attached database statement is so before executing that command you should be inside SQLite so use SQLite 3 so I’m inside the SQLite terminal and then we can use something like attach and make sure that this is in uppercase letters attached make sure that it is in uppercase letters so attach followed by database as so this is my existing database and I want to attach with the name attached test so the database names okay let’s before that let’s list the list of databases available we can use dot database okay we do not have any databases at this moment so we will attach database test our database and I am attaching the tester database as test attach and remember every SQLite statement should end with semicolon so to see the list of available databases we can use dot database so if you see you have test attached and we it is pointing to tester TB the database names main and test attached are reserved for the primary database and database to hold temporary tables and other temporary data objects both of these database names exist for every database connection and should not be used for attachment otherwise you will get a warning message we will see what warning we will get so I want to use this previous command once again so you are getting another database test a Tet is already in use okay so we cannot use the attached database name more than once

Tags:






Youtube
Facebook
Google Plus
Twitter
TutorialDrive


Apache Zookeeper Tutorial

Apache Kafka Tutorial

Apache Kafka Security

Elasticserarch n Kibana

Java 8 Tutorial

Log4J Tutorial

Apache Storm Tutorial

SQLite Tutorial

Apache Ant Tutorial

Related Posts

blog

Apache Kafka Commands Cheat sheet

Spread the loveKafka Topics List existing topics bin/kafka-topics.sh –zookeeper localhost:2181 –list Purge a topic bin/kafka-topics.sh –zookeeper localhost:2181 –alter –topic mytopic –config retention.ms=1000 … wait a minute … bin/kafka-topics.sh –zookeeper localhost:2181 –alter –topic mytopic –delete-config retention.ms
Read more…

blog

What is Apache Maven | Apache Maven complete tutorial from scratch pdf

Spread the love In this post you will learn the complete tutorial of Apache Maven build tool What is Maven ? Apache Maven is a software project management and comprehension tool. Based on the concept
Read more…

blog

Practical Guide for Web Development in 2018

Spread the loveWelcome to my practical guide  for web development in 2018 in terms of  technology and career. Before we start I just want to  mention a few things, you don’t need to learn  everything that
Read more…