CREATE TABLE TEAMS
(TEAMNO INTEGER NOT NULL,
PLAYERNO INTEGER NOT NULL,
DIVISION CHAR(6) NOT NULL,
PRIMARY KEY (TEAMNO) );
CREATE TABLE PENALTIES
(PAYMENTNO INTEGER NOT NULL,
PLAYERNO INTEGER NOT NULL,
PAYMENT_DATE DATE NOT NULL,
AMOUNT DECIMAL(7,2) NOT NULL,
PRIMARY KEY (PAYMENTNO) );
INSERT INTO TEAMS VALUES(1, 6, 'first');
INSERT INTO TEAMS VALUES (2, 27, 'second');
INSERT INTO PENALTIES VALUES(1, 6, '1980-12-08',100);
INSERT INTO PENALTIES VALUES (2, 44, '1981-05-05', 75);
INSERT INTO PENALTIES VALUES (3, 27, '1983-09-10',100);
INSERT INTO PENALTIES VALUES (4,104, '1984-12-08', 50);
INSERT INTO PENALTIES VALUES (5, 44, '1980-12-08', 25);
INSERT INTO PENALTIES VALUES (6, 8, '1980-12-08', 25);
INSERT INTO PENALTIES VALUES (7, 44, '1982-12-30', 30);
INSERT INTO PENALTIES VALUES (8, 27, '1984-11-12', 75);
- Add a new column called Founded of type date to the TEAMS table after the TEAMNO.
- Add a new column called Paid of type char (1) to the PENALTIES table.
Please find the detailed answer in the following steps.
Step by stepSolved in 3 steps with 2 images
- How exactly would this be done?arrow_forwardCREATE TABLE PENALTIES (PAYMENTNO INTEGER NOT NULL, PLAYERNO INTEGER NOT NULL, PAYMENT_DATE DATE NOT NULL, AMOUNT DECIMAL(7,2) NOT NULL, PRIMARY KEY (PAYMENTNO) ); CREATE TABLE MATCHES (MATCHNO INTEGER NOT NULL, TEAMNO INTEGER NOT NULL, PLAYERNO INTEGER NOT NULL, WON SMALLINT NOT NULL, LOST SMALLINT NOT NULL, PRIMARY KEY (MATCHNO) ); INSERT INTO PENALTIES VALUES (1, 6, '1980-12-08',100); INSERT INTO PENALTIES VALUES (2, 44, '1981-05-05', 75); INSERT INTO PENALTIES VALUES (3, 27, '1983-09-10',100); INSERT INTO PENALTIES VALUES (4,104, '1984-12-08', 50); INSERT INTO PENALTIES VALUES (5, 44, '1980-12-08', 25); INSERT INTO PENALTIES VALUES (6, 8, '1980-12-08', 25); INSERT INTO PENALTIES VALUES (7, 44, '1982-12-30', 30); INSERT INTO PENALTIES VALUES (8, 27, '1984-11-12', 75); INSERT INTO MATCHES VALUES ( 1, 1, 6, 3, 1); INSERT INTO MATCHES VALUES ( 2, 1, 6, 2, 3); INSERT INTO MATCHES VALUES ( 3, 1, 6, 3, 0); INSERT INTO MATCHES VALUES ( 4, 1, 44, 3, 2); INSERT INTO MATCHES VALUES ( 5, 1,…arrow_forwardTask 9: Create the DISP_PROPERTYS procedure to retrieve and output the office number, address, monthly rent, and owner number for every property whose square footage is equal to the square footage stored in I_SQR_FT (provided as a parameter). Store these values in I_LOCATION_NUM, I_ADDRESS, I_MONTHLY_RENT, and I_OWNER_NUM and display them when the procedure is called.arrow_forward
- CREATE OR REPLACE PROCEDURE PROCUNO ( W_ID IN NUMBER ) W_FLAG W TAX W MSG NUMBER : = 0 ; NUMBER : = 0 ; NUMBER : = 0 ; STRING ( 20 ) : = " ; BEGIN SELECT COUNT ( * ) INTO W_FLAG FROM COMPRA WHERE COMPRA_ID - W_ID ; W_TAX : - W_X * 0.115 ; IF W_FLAG = 1 THEN SELECT SUM ( CANTIDADCOMPRADA * PRECIO ) INTO W_X FROM PRODUCTO_COMPRADO WHERE PRODUCTO COMPRADO.COMPRA_ID = W_ID ; UPDATE COMPRA SET COMPRA_X = W_X , ELSE WHERE COMPRA_ID = W_ID ; W_MSG : = ' mensajel " ; END IF ; COMPRA_TAX = W_TAX , COMPRA_TOTAL = W_X + W_TAX W_MSG : = ' mensaje2 ' ; END ;arrow_forwardcreate database GA2gouse GA2gocreate table salesman(salesman_id int primary key, name varchar(30), city varchar(20), commission varchar(30));insert into salesman (salesman_id, name, city, commission) values (5001, 'James Hoog', 'New York', 0.15); insert into salesman (salesman_id, name, city, commission) values (5002, 'Nail Knite', 'Paris', 0.13); insert into salesman (salesman_id, name, city, commission) values (5005, 'Pit Alex', 'London', 0.11); insert into salesman (salesman_id, name, city, commission) values (5006, 'Mc Lyon', 'Paris', 0.14); insert into salesman (salesman_id, name, city, commission) values (5007, 'Paul Adam', 'Rome', 0.13); insert into salesman (salesman_id, name, city, commission) values (5003, 'Lauson Hen', 'San Jose', 0.12); Create table Customer (customer_id int primary key, cust_name varchar(30), city varchar(10), grade varchar(30), salesman_id int,CONSTRAINT FK_salesman_id FOREIGN KEY (salesman_id) REFERENCES salesman(salesman_id));insert into customer…arrow_forwardCREATE TABLE sales ( SalesNumber INT(10) AUTO_INCREMENT PRIMARY KEY, SalesDate DATE, SalesTotal DECIMAL(10,2)); CREATE TABLE products ( number INT(11) AUTO_INCREMENT PRIMARY KEY, prodid VARCHAR(20) UNIQUE, prodname VARCHAR(30), price DECIMAL(10,2), onhand INT(11), CONSTRAINT fk_salesdetails_products FOREIGN KEY (prodid) REFERENCES salesdetails(prodid) ON DELETE RESTRICT); CREATE TABLE salesdetails ( number INT(10) AUTO_INCREMENT PRIMARY KEY, SalesNumber INT(10), prodid VARCHAR(20), price DECIMAL(7,2), qty INT(10), CONSTRAINT fk_salesdetails_sales FOREIGN KEY (SalesNumber) REFERENCES sales(SalesNumber) ON DELETE CASCADE, CONSTRAINT fk_salesdetails_products FOREIGN KEY (prodid) REFERENCES products(prodid) ON DELETE CASCADE); Using the above SQL and the schema diagram, create an ER diagram detailing all the fields of the tables and the relationship amount the tables.arrow_forward
- Create a formula that provides the start date of a project as follows: In cell H4, begin to enter a formula using the INDEX Use the Lookup table (range A2:E23) as the array. For the row_num argument, use the MATCH Use the Project ID (cell H2) as the lookup_value for the MATCH function. Use the ID column (range A2:A23) as the lookup_array for the MATCH function. Specify an exact match (0) for the MATCH function. Use the Start Date column (column 4) as the column_num for the INDEX function.arrow_forwardPlease write a view to list staff’s names, salary, ages, and their supervisors’names, salary, and ages for all staff whose supervisor’s age is younger than the staff’s age and theirsupervisor’s salary is higher than the staff’s salary. You should use Staff2 table. The output headerneeds to distinguish between staff and manger: (E_name, E_salary, E_age, M_name, M_salary, M_age)arrow_forwardSQL CODE FOR For the players who show up in Batting, Bowling, and Fielding tables, create a list that shows their names, runs they have scored, wickets they have taken, and catches they have taken? table is in picture (bowling table is same as batting and fielding )arrow_forward
- Richardson Ski Racing (RSR) sells equipment needed for downhill ski racing. One of RSR's products is fencing used on downhill courses. The fence product comes in 150-foot rolls and sells for $215 per roll. However, RSR offers quantity discounts. The following table shows the price per roll depending on order size: Quantity Ordered To Price per Roll From 1 70 $215 71 140 $195 141 280 $175 281 and up $155 Click on the datafile logo to reference the data. DATA file (a) Use the VLOOKUP function with the preceding pricing table to determine the total revenue from these orders. (b) Use the COUNTIF function to determine the number of orders in each price bin. From Number of To Price per Roll 70 $215 !!! 140 $195 280 $175 and up $155 1 71 141 281 Orders 172arrow_forwardhow to insert the following: Insert Into Director Values(1,'Josh','Klemm',1) Insert Into Director Values(2,'Jeff','Bezos',10) Insert Into Director Values(1,'Elon','Musk',50) Insert Into Director Values(3,'Elon','Musk',500000) Insert Into Director Values(3,'Elon','Musk',5)arrow_forwardInsert any 5 rows of athletes including your details into the Athletics table you created in the previous Question. The table created previously CREATE TABLE Athletics ( AthleteID int NOT NULL First_name varchar(255) NOT NULL, Last_name varchar(255) NOT NULL, DOB DATE NOT NULL, SportsCode INT, Date_Last_event DATE, PRIMARY KEY (ID) ); varchar(255) use for define string column, int stand for integer field etc.arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education