· 6 years ago · Jun 23, 2019, 11:24 PM
1CREATE TABLE Accounts (
2 account_id int AUTO_INCREMENT NOT NULL,
3 customer_id int NOT NULL,
4 account_name varchar(150) NOT NULL,
5 account_description varchar(150) NULL,
6 CONSTRAINT PK_Accounts PRIMARY KEY (account_id ASC)
7);
8
9/* Add data to the accounts table */
10
11
12/* Create Customers Table */
13
14DROP TABLE IF EXISTS Customers;
15
16CREATE TABLE Customers(
17 customer_id int AUTO_INCREMENT NOT NULL,
18 customer_firstname varchar(150) NOT NULL,
19 customer_lastname varchar(150) NULL,
20 customer_address varchar(250) NULL,
21 customer_phone varchar(50) NOT NULL,
22 customer_email varchar(150) NULL,
23CONSTRAINT PK_customers PRIMARY KEY (customer_id ASC)
24);
25
26/* Insert customers data into the table */
27
28insert into `Customers`(`customer_id`,`customer_firstname`,`customer_lastname`,`customer_address`,`customer_phone`,`customer_email`) values
29 (101, 'John', 'Doe', '123 Any St., Anytown, FL 32333','212-555-1212','doej@email.com'),
30 (102, 'Jane','Doe', '123 Any St., Anytown, FL 32333', '212-555-1313','doej2@email.com'),
31 (103, 'Frank', 'Sellars', '144 Franklin Ave, Miami, FL 32399', '212-555-5511', 'sellarsf@email.com'),
32 (104, 'Sue', 'Sellars', '144 Frankin Ave, Miami, FL 32399', '212-555-4123', 'sellarss@email.com');