Today we are going to discuss about how to use databases and how can you create tables. So don't worry about it, we will discuss about the table creation in our later lectures. But for now I'm going to view the table. So, we can perform some SQL statement or some SQL command on that table. So, first of all, it is totally depend upon you that either you are using the SQL, PHP myadmin from the local rows on the browser or if you have actually, like, did a grid we have discussed about the political interviews lectures. But if you are using SQL yo or, or other tools, it's totally depend upon you.
But okay, so now as you can see, I have this tool. Now I'm saying, Oh, please show me the databases. So databases, so semicolon, right click, enter, sorry Ctrl Enter To execute your query or if you need just need to press the control button plus press the Enter button. Okay, so now as you can see it's showing you the databases school is that it is a database we have just which we have clearly created in our previous lecture. Okay, now how can you create your database now I'm saying that I'm going to create the database named students or university Okay, so now I'm saying create this is the syntax to create the database, create database, write your database name here database name here, XYZ. Now I am saying University semicolon, the custom database required semicolon whenever you terminate the statement.
So that's why it's best practice to use a semicolon Ctrl Enter To execute your query so we can see now University database is not available here so as you can see, okay, now I'm saying control input. Now I'm saying show databases, control interest as you can see, we have just created the database name University. Now I'm saying select straight from university, which table because we have not created the table yet. Now I am saying table. So as you can see, the my the children whose which is a data grid, already giving you the hints. So now I'm saying how can you create your table now I'm saying CREATE TABLE which table Saying students and the values.
The columns are I'm saying s ID is a mean student ID is an integer field. And now I'm saying it because it means that we always assign the value in this column, make sure it's not null, not null, and also auto increment. And surprisingly, you don't worry about it. We will discuss about the primary key in our later lectures. And don't worry about it. That if you're not familiar with how can you create your tables, we will discuss about how to create tables deeply in our lectures, but for now, I'm creating the table so I can perform some x SQL statement or I can execute SQL.
Okay, now I am saying s name that is the name is Marshall field, and I'm saying your school hundred in now. Comma, and say As a city that means to watch or fail, and say it's 200. Now, comma, and I'm saying so address. Now I'm saying there's a text food because wash our means you always give the length of the character 200 not more than 200 Okay, that means you always give some extra as possible you have a stressful, okay, now I'm saying that inter control, press the Enter button. So now I'm saying SHOW TABLES, sorry, tables Ctrl Enter button. So as you can see, it's showing you the table in the Union Street database as you can see tables in St. Louis.
Now if I'm saying that select static from students control information, make sure to execute your query in data quit. Just Press the CTRL button and hit the enter button. Okay or right click Execute. So as you can see they are saying the control interface. Now as you can see it's showing you the empty extract insert the data in the table, how to insert Don't worry about it, we will discuss about the end. How can you do a database or a table How can insert a delete GIS functionality in our later lectures.
But for now, I'm just showing you that you can insert you can create like this. Okay, now I am saying insert insert into tables which tables students and which columns I'm saying the columns are s name, s city and the address as you can see, I'm saying I am going to provide only the sp sp sp Less, why? Because this is the auto increment fee and also the primary key. So now I'm saying the values are because I'm giving I'm giving the three columns. That's why I have to provide a key value. Now I'm saying Shakthi.
Now I'm saying London. Now I'm saying sci fi, defense view. Okay, now Ctrl Z to execute your query Ctrl, enter. Now, I am saying select static from students right here. You can see we have successfully insert inserted one record. Now I'm going to insert some other records.
And I'm saying Ozma. So it's, she's from India, India, and at Press X Y Zed. I'm saying India has Navarre, Kenya now and they're basically me and I have inserted to the horse. Now I'm saying that car now he's from suppose USA, USA sorry is slower okay now I'm saying three is three or 30 speed slower okay now it controls in that I have added three records now I'm going to create Shakthi fourth record is also from Islamic law and the address is okay see now I'm saying Ctrl Enter. So now I'm saying select the static form students Harlan because I have the statement Ctrl Enter to make use as you can see we have inserted for record for it's automatically generating the Siv that means student I AWS we have used this schema auto increment and this is the primary key primary key means you always use the unique key so 1234 you cannot repeat this possible if you have one one ID oh that means they are not unique.
Okay, so we have four values. In the next session. We are going to cover some other topics. Thank you