0% found this document useful (0 votes)
6 views2 pages

Database

The document outlines SQL commands to create a database named ECOBANK and four tables: Employee, Customer, Loan, and Savings. Each table includes various fields with specific data types and constraints. There are some syntax errors, such as 'AUTO_INCREAMENT' which should be 'AUTO_INCREMENT' and 'IF NOT EXIST' which should be 'IF NOT EXISTS'.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

Database

The document outlines SQL commands to create a database named ECOBANK and four tables: Employee, Customer, Loan, and Savings. Each table includes various fields with specific data types and constraints. There are some syntax errors, such as 'AUTO_INCREAMENT' which should be 'AUTO_INCREMENT' and 'IF NOT EXIST' which should be 'IF NOT EXISTS'.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

CREATE DATABASE IF NOT EXISTS ECOBANK;

USE ECOBANK;

CREATE TABLE IF NOT EXISTS Employee(

ID INT UNIQUE PRIMARY KEY AUTO_INCREAMENT,

FIRSTNAME VARCHAR(50) NOT NULL,

LASTNAME VARCHAR(50) NOT NULL,

CONTACT VARCHAR(10) UNIQUE,

EMAIL VARCHAR(1000) UNIQUE

);

CREATE TABLE IF NOT EXIST CUSTOMER(

ID INT UNIQUE PRIMARY KEY AUTO_INCREAMENT,

NAME VARCHAR(50) NOT NULL,

LASTNAME VARCHAR(50) NOT NULL,

LOCATION VARCHAR(50) UNIQUE,

CONTACT VARCHAR(10) NOT NULL

);

CREATE TABLE IF NOT EXIST LOAN(

ID INT UNIQUE PRIMARY KEY AUTO_INCREAMENT,

CUSTOMER_ID VARCHAR(100) UNIQUE,

LOAN_AMOUNT VARCHAR(10000) UNIQUE,

DATE VARCHAR(20) NOT NULL

);

CREATE TABLE IF NOT EXIST SAVINGS(

ID INT UNIQUE PRIMARY KEY AUTO_INCREAMENT

CUSTOMER_ID VARCHAR(50) NOT NULL,

AMOUNT VARCHAR(10000) UNIQUE,


SAVINGS_TYPE VARCHAR(50) NOT NULL

);

You might also like