I am trying to make a database design in mysql with column names of client, cont
ID: 3548989 • Letter: I
Question
I am trying to make a database design in mysql with column names of client, contact, email, sales person.
The instrutions are: MySQL Server and MySQL Workbench. In this schema, create all the necessary tables, columns, and relationships to complete your database.
do I need to put in the sql code to create a table? can you provide example. I have this much CREATE TABLE `client` (
`client_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`first_name` varchar(45) NOT NULL,
`last_name` varchar(45) NOT NULL,
`last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`client_id`),
KEY `idx_client_last_name` (`last_name`)
) ENGINE=InnoDB AUTO_INCREMENT=201 DEFAULT CHARSET=utf8;
Explanation / Answer
Yes you do need sql code for that.
Here is a general example:
CREATE TABLE table_name
(
column_name1 data_type(size),
column_name2 data_type(size),
column_name3 data_type(size),
....
);
Here is a specific example:
CREATE TABLE Persons
(
PersonID int,
LastName varchar(255),
FirstName varchar(255),
Address varchar(255),
City varchar(255)
);
Please rate
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.