The document provides SQL syntax to create tables for a banking database including tables for banks, employees, customers, and accounts. It also includes INSERT statements to add initial records to each table. The document then lists exercises to alter the tables by adding, removing, and modifying columns and capturing the table structure before and after each alteration.
The document provides SQL syntax to create tables for a banking database including tables for banks, employees, customers, and accounts. It also includes INSERT statements to add initial records to each table. The document then lists exercises to alter the tables by adding, removing, and modifying columns and capturing the table structure before and after each alteration.
The document provides SQL syntax to create tables for a banking database including tables for banks, employees, customers, and accounts. It also includes INSERT statements to add initial records to each table. The document then lists exercises to alter the tables by adding, removing, and modifying columns and capturing the table structure before and after each alteration.
(BankID INTEGER NOT NULL UNIQUE, BankName VARCHAR(20) NOT NULL, BankAddress VARCHAR(20), BankPhoneNumber VARCHAR(20), PRIMARY KEY(BankID));
CREATE TABLE EMPLOYEE
(EmpID INTEGER NOT NULL UNIQUE, EmpLName VARCHAR(50) NOT NULL, EmpFName VARCHAR(20), EmpAddress VARCHAR(50), EmpPosition VARCHAR(50), BankID INTEGER, PRIMARY KEY(EmpID), FOREIGN KEY (BankID) REFERENCES BANK); CREATE TABLE CUSTOMER (CustomerID INTEGER NOT NULL UNIQUE, FirstName VARCHAR(50), LastName VARCHAR(20) NOT NULL, StreetAddress VARCHAR(50), City VARCHAR(20), State VARCHAR(10), ZIP VARCHAR(10), BankID INTEGER, PRIMARY KEY(CustomerID), FOREIGN KEY(BankID) REFERENCES BANK);
CREATE TABLE ACCOUNT
(CustomerID INTEGER NOT NULL , AccountNumber INTEGER NOT NULL UNIQUE, AccountType VARCHAR(20), DateOpened VARCHAR(20), Balance FLOAT, PRIMARY KEY(AccountNumber), FOREIGN KEY(CustomerID) REFERENCES CUSTOMER); Exercise: Insert the record into the table using insert syntax. Save the query and paste in your word.