



Task 1 : ALTER customer ADD( city varchar(15) NOT NULL);
Task 2 : UPDATE TOP(5) customer SET city='Delhi'
ORDER BY customer_id; //For top 5 rows
Task 3 : UPDATE TOP(5) customer SET city='Mumbai'
ORDER BY customer_id DESC; //For bottom 5 rows
Task 4 :-> INSERT INTO customer
VALUES(11223344,'Rohan','Malik','Amritsar');
-> INSERT INTO customer
VALUES(11223346,'Rishi','Verma','Delhi');
-> INSERT INTO customer
VALUES(11223348,'Vishwas','Rana','Mumbai');
-> INSERT INTO customer
VALUES(11223350,'Lalit','Kumar','Kolkata');
-> INSERT INTO customer
VALUES(11223352,'Naman','Adab','Pune');
Task 5 : INSERT INTO flight
VALUES(40221211,'Delhi','Amritsar','2019-07-14 10:23:00','2019-07-14 12:40:00',16644551);
-> INSERT INTO flight
VALUES(40221212,'Delhi','Mumbai','2019-07-16 11:25:00','2019-07-16 14:40:00',16644555);
Task 6 : INSERT INTO flight_reservation
VALUES(40221211,11223344);
-> INSERT INTO flight_reservation
VALUES(40221212,11223348);
Task 7 : DELETE FROM flight WHERE from_city='Seattle' AND to_city='Las Vegas' ;
Overview: Database management plays an integral role in nearly every area of business. Databases house customer, accoun...
Help In Database: Next comes the data entry: Make up data for your database, or find real data. You can enter the data with INSERT statements, but it is much easier to use PhpAdmin. It has a form where you can type the data directly. Alternatively, you can use PhpAdmin to import CSV data (comma-separated values), which you can export from Excel. Include at least 3 rows in each of the entity relations, and as many rows as you need...
Database Management
6. [5] Create the following table: CREATE TABLE customer ( cust_name VARCHAR(30) NOT NULL, address VARCHAR(60), UNIQUE (cust name, address)); A. Run the following inserts and explain why both work and how will you prevent it INSERT INTO customer VALUES ('Alex Doe', NULL); INSERT INTO customer VALUES ('Alex Doe', NULL); 7. [5] Modify the following table definition to ensure that all employees have a minimum wage of $10 CREATE TABLE employee ( empId INT PRIMARY KEY, empName VARCHAR(40)...
use workbench please
Task 1: Create a database and name it practical2DB. (2
marks)
Task 2: Create all the four tables according to the relational
scheme in Figure 1. (8 marks)
Task 3: Insert 5 records to into each table. (5 marks)
Task 4: Write a query to list alphabetically ordered names,
addresses, and IDs of all the customers whose postcode is in
(40150, 40400, 47500).
(10 marks)
Task 5: Delete 1 record from Products table using their primary
keys....
Create a table tHW2_1_xxxx with the following fields and their data types (id:int, auto increment, Name: varchar(10), birthday: date, annual_salary: float, bno: varchar(8)), where id is primary key and bno is a foreign key to the branchno column of Branch table in the dreamhome database. All fields cannot be null. then insert five records into your tHW2_1_xxxx table. All the name, birthday, should be different.
CREATE TABLE Gender ( gender CHAR(1), description VARCHAR(10), PRIMARY KEY (gender) ); CREATE TABLE People ( ID INT, name VARCHAR(50), gender CHAR(1), height FLOAT, PRIMARY KEY (ID), FOREIGN KEY (gender) REFERENCES Gender (gender) ); CREATE TABLE Sports ( ID INT, name VARCHAR(50), record FLOAT, PRIMARY KEY (ID), UNIQUE (name) ); CREATE TABLE Competitions ( ID INT, place VARCHAR(50), held DATE, PRIMARY KEY (ID) ); CREATE TABLE Results ( peopleID INT NOT NULL, competitionID INT NOT NULL, sportID INT NOT NULL,...
Someone Please Help Me modify this in PHP I'm in desperate need I cant figure this out ... Make the following modifications: For the vendors table: Comment out the table-level primary key Change the VendorIDcolumn to be a column-level primary key Add a VendorEmail column to the bottom of the table definition (define the data type for the column as variable character and set it to not exceed 45 characters) After the lineItems table, add code to create a table...
Using MySQL commands answer the questions listed below using the Premier Products Company schema. 1.Using Views a) Create a view called part_location that has the following attributes: part_num, part_description, part_quantity, warehouse_name, warehouse_address. This data comes from the part and warehouse entities. b) Write a query using the view that shows the total number of parts ordered from each warehouse. The output should look like this: 2. Using Triggers a) Execute the following SQL to create the customer_audit table in the...
Assume that The Queen Anne Curiosity Shop designs a database with the following tables. CUSTOMER (CustomerID, LastName, FirstName, EmailAddress, EncyptedPassword, City, State, ZIP, Phone, ReferredBy) EMPLOYEE (EmployeeID, LastName, FirstName, Position, Supervisor, OfficePhone, EmailAddress) VENDOR (VendorID, CompanyName, ContactLastName, ContactFirstName, Address, City, State, ZIP, Phone, Fax, EmailAddress) ITEM (ItemID, ItemDescription, PurchaseDate, ItemCost, ItemPrice, VendorID) SALE (SaleID, CustomerID, EmployeeID, SaleDate, SubTotal, Tax, Total) SALE_ITEM (SaleID, SaleItemID, ItemID, ItemPrice) The referential integrity constraints are: ReferredBy in CUSTOMER must exist in CustomerID in CUSTOMER Supervisor...
1. Write a script that creates a user-defined database role named OrderEntry in the MyGuitarShop database. Give INSERT and UPDATE permission to the new role for the Orders and OrderItems table. Give SELECT permission for all user tables. 3) Write a script that uses dynamic SQL and a cursor to loop through each row of the Administrators table and (1) create a login ID for each row in that consists of the administrator�s first and last name with no space...
For this hands-on project, you will use the SQL Server named instance SQLSERVERHOA, and the HandsOnOne database and tables you created in previous chapters. The objective of this activity is to practice generating keys and encrypting/decrypting data. Document each step by taking a screen shot of the Query Editor window after successfully executing each SQL query. 1.In SQL Server Management Studio, open a new Query Editor window, which you will use for completing all steps in this activity. 2.Create a...