Using MySQL, you will create data base for given conditions and examine the mysqldump.
•Create the table for the given data structure
PASSENGERS: passengerid INTEGER, name VARCHAR(30), surname VARCHAR(30), email VARCHAR(50), address VARCHAR(100), city VARCHAR(30)
FLT-SCHEDULE: fltno INTEGER, airlinename VARCHAR(50), dtime TIME, from-airportcode VARCHAR(5), atime TIME, to-airportcode VARCHAR(5), miles INTEGER, price INTEGER
FLT-HISTORY: passengerid INTEGER, airlineid INTEGER, fltdate DATE
AIRLINE: airlineid INTEGER, airlinename VARCHAR(50)
-Conditions-
•You can use WAMP server and by using mysqldump command to dump the data base.
•It must be dump document with a .sql extension.
CREATE TABLE PASSENGERS (
passengerid INTEGER PRIMARY KEY,
name VARCHAR(30) UNIQUE,
surname VARCHAR(30) UNIQUE,
email VARCHAR(50) UNIQUE,
address VARCHAR(100) UNIQUE,
city VARCHAR(30) UNIQUE
);
CREATE TABLE FLT_SCHEDULE (
fltno INTEGER PRIMARY KEY,
airlinename VARCHAR(50),
dtime TIME,
from_airportcode VARCHAR(5),
atime TIME,
to_airportcode VARCHAR(5),
miles INTEGER,
price INTEGER
);
CREATE TABLE FLT_HISTORY (
passengerid INTEGER,
airlieneid INTEGER,
fltdate DATE PRIMARY KEY
);
CREATE TABLE AIRLINE (
airlineid INTEGER PRIMARY KEY,
airlinename VARCHAR(50)
);
Using MySQL, you will create data base for given conditions and examine the mysqldump. •Create t...
Create a new database and execute the code below in SQL Server’s query window to create the database tables. CREATE TABLE PhysicianSpecialties (SpecialtyID integer, SpecialtyName varchar(50), CONSTRAINT PK_PhysicianSpecialties PRIMARY KEY (SpecialtyID)) go CREATE TABLE ZipCodes (ZipCode varchar(10), City varchar(50), State varchar(2), CONSTRAINT PK_ZipCodes PRIMARY KEY (ZipCode)) go CREATE TABLE PhysicianPractices (PracticeID integer, PracticeName varchar(50), Address_Line1 varchar(50), Address_Line2 varchar(50), ZipCode varchar(10), Phone varchar(14), Fax varchar(14), WebsiteURL varchar(50), CONSTRAINT PK_PhysicianPractices PRIMARY KEY (PracticeID), CONSTRAINT FK_PhysicianPractices_ZipCodes FOREIGN KEY (ZipCode) REFERENCES Zipcodes) go CREATE...
Based on the CREATE TABLE
statements, make an ER model of the database. Give suitable names
to the relationships. (Remember cardinality and participation
constraints.) The diagram must use either the notation used in the
textbook (and the lectures) or the crow’s foot notation. To save
you some time: There are a few tables that include the following
address fields: Address, City, State, Country and PostalCode (and
the same fields with the prefix Billing-). You are allowed to
replace these attributes...
WRITING POSTGRESQL QUERIES RELATIONS: CREATE TABLE Movies( movieID INT, year INT UNIQUE, rating CHAR(1), length INT, totalEarned NUMERIC(7,2), PRIMARY KEY(movieID) ); CREATE TABLE Theaters( theaterID INT, address VARCHAR(40) UNIQUE, numSeats INT NOT NULL, PRIMARY KEY(theaterID) ); CREATE TABLE TheaterSeats( theaterID INT, seatNum INT, brokenSeat BOOLEAN NOT NULL, PRIMARY KEY(theaterID, seatNum), FOREIGN KEY(theaterID) REFERENCES Theaters ); CREATE TABLE Showings( theaterID INT, showingDate DATE, ...
Create three or more MySQL Data Control language (DCL) Statements using the Youth League Database. 1. A Create new user statement for the database 2. A statement that grants privileges to the new user 3. A statement that revokes privileges 1. A SQL Text File containing the SQL commands to create the database, create the table, and insert the sample test data into the table. 2. A SQL Text File containing the DCL SQL Statements. eted hemas Untitled Limit to...
Sample data is provided for the database for the sales system. Using the sample data, you will determine the entities, key components of the entities, and business rules for the entities. Using the entities and business rules you will then create an ERD. Tasks: 1. For each entity provide the name, description, fields, data type, primary key, and foreign key. 2. For each direct entity type pair, provide the business rules. 3. Provide the ERD. Customer Table Customer ID, Last...
SQL Query Question: I have a database with the tables below, data has also been aded into these tables, I have 2 tasks: 1. Add a column to a relational table POSITIONS to store information about the total number of skills needed by each advertised position. A name of the column is up to you. Assume that no more than 9 skills are needed for each position. Next, use a single UPDATE statement to set the values in the new...
Using the Table and data below, create a procedure that accepts product ID as a parameter and returns the name of the product from ProductTable table. Add exception handling to catch if product ID is not in the table. Please use Oracle SQL and provide screenshot. Thanks! CREATE TABLE ProductTable( ProductID INTEGER NOT NULL primary key, ProductName VARCHAR(50) NOT NULL, ListPrice NUMBER(10,2), Category INTEGER NOT NULL ); / INSERT INTO ProductTable VALUES(299,'Chest',99.99,10); INSERT INTO ProductTable VALUES(300,'Wave Cruiser',49.99,11); INSERT INTO ProductTable...
I NEED TO WRITE THE FOLLOWING QUERIES IN MYSQL (13)Next, grant to a user admin the read privileges on the complete descriptions of the customers who submitted no orders. For example, these are the customers who registered themselves and submitted no orders so far. The granted privilege cannot be propagated to the other users. 0.3 (14)Next, grant to a user admin the read privileges on information about the total number of orders submitted by each customer. Note, that some customers...
Create an ER model for the scenario. Make sure that you read the description carefully. Your diagram should reflect all entities, attributes, and relationships in the description. You should make sure each entity has a primary key (a unique identifier). Use the relationship types we used in class (one-to-one, one-to-many, or many-to-many). Don't forget, attributes can describe both entities and relationships. Scenario 2: Tracking Trips for the SchUber Taxi Service A new Philadephia startup called SchUber is a matching service...
-- Schema definition
create table Customer (
cid smallint not null,
name varchar(20),
city varchar(15),
constraint customer_pk
primary key (cid)
);
create table Club (
club varchar(15) not null,
desc varchar(50),
constraint club_pk
primary key
(club)
);
create table Member (
club varchar(15) not null,
cid
smallint not null,
constraint member_pk
primary key (club,
cid),
constraint mem_fk_club
foreign key (club)
references Club,
constraint mem_fk_cust...