SQL Getting Started Tutorial: SQL creation table create tables and database [create DATABSE]
In the declaration of creating a database
The CREATE DATABASE statement is used to set up a data base.
SQL syntax for creating a database
CREATE DATABASE database_name
Example of creating a database now, we are going to build a database called "my_db". We use the following CREATE DATABASE statement: CREATE DATABASE my_db
Here's a look at the SQL creation table create tables
In creating a table declaration in creating a table declaration is used to create a table in the database. Creating table SQL syntax CREATE TABLE table_name
(
Column_name1 Data_type,
Column_name2 Data_type,
Column_name3 Data_type,
....
)
Data types specify what type of data columns can be shelved. For a complete reference of all data types provided by Ms Access, MySQL, and SQL Server, please give us a complete data type reference. Example of creating a table now, we're going to create a table called "people" that contains five columns: p_id, last name, address, and city. We use the following creation Table declaration: CREATE TABLE Persons
(
p_id int,
LastName varchar (255),
FirstName varchar (255),
Address varchar (255),
City varchar (255)
)
The p_id column is of type int and held some. Last name, first name, address, and city column varchar The maximum length of the type is 255 characters. The blank "People" table now looks like this: _id LastName FirstName Address City