Skip to content

This is my last work done and best projects do it with SQL Databases this repo involves MySQL, SQL Server, PostgreSQL and Microsoft Access.

Notifications You must be signed in to change notification settings

RubenGavidia/Databases_mysql_sql-server_PostgreSQL.SQL_Portfolio_RubenGavidia0x

Repository files navigation

SQL SERVER 45$

#NormalizationPart1

query SLide2 query Slide3

#NormalizationPart2

query 10

query 10


DROP DATABASE IF EXISTS BankAccountDatabase;

CREATE DATABASE  BankAccounDatabase;

-- USE BankAccountDatabase;

DROP TABLE IF EXISTS Customer;
CREATE TABLE Customer(CustomerNumber char(5) PRIMARY KEY,[CustomerName] varchar(255));

INSERT INTO Customer VALUES('10001','Bill Evans');
INSERT INTO Customer VALUES('21998','John Smith');
INSERT INTO Customer VALUES('23444','John Smith');
INSERT INTO Customer VALUES('66111','Mary Valerte');

DROP TABLE IF EXISTS Account;
CREATE TABLE   Account (AccountNumber char(5) PRIMARY KEY, AccountType varchar(15), DateOpened DATE );

INSERT INTO Account VALUES ('90005', 'Checking','1/15/2002');
INSERT INTO Account VALUES ('50022', 'Savings', '1/13/2015');
INSERT INTO Account VALUES ('22001', 'Mortgage','7/22/2020');
INSERT INTO Account VALUES ('91101', 'Checking','11/1/2009');
INSERT INTO Account VALUES ('22111', 'Home Equity','1/12/2011');

DROP TABLE IF EXISTS CustomerAccount;
CREATE TABLE   CustomerAccount (CustomerNumber char(5), AccountNumber char(5), PRIMARY KEY (CustomerNumber, AccountNumber));

INSERT INTO CustomerAccount VALUES ('10001', '90005');
INSERT INTO CustomerAccount VALUES ('10001', '50022');
INSERT INTO CustomerAccount VALUES ('21998', '22001');
INSERT INTO CustomerAccount VALUES ('23444', '91101');
INSERT INTO CustomerAccount VALUES ('66111', '22111');
INSERT INTO CustomerAccount VALUES ('23445', '91101');

ALTER TABLE CustomerAccount ADD CONSTRAINT FK_Customer FOREIGN KEY (CustomerNumber) REFERENCES Customer (CustomerNumber) ON UPDATE CASCADE ON DELETE CASCADE;
ALTER TABLE CustomerAccount ADD CONSTRAINT FK_Account FOREIGN KEY (AccountNumber) REFERENCES Account (AccountNumber) ON UPDATE CASCADE ON DELETE CASCADE;

#Queries

query 10

query 9

query 8

query 7

query 6

query 10

query 11

query 12

query 13

query 14

query 15

query 16

query 5

query 4

query 3

query 2

query 1

Microsoft Access:

access chart1

access chart0

SQL QUERIES:

MYSQL

SQL Query ACCESS REPETITIVE DATA

SQL-ACCESS

About

This is my last work done and best projects do it with SQL Databases this repo involves MySQL, SQL Server, PostgreSQL and Microsoft Access.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published