Write the command to increase the price of all the products

Assignment Help PL-SQL Programming
Reference no: EM133271869

Activity: Check Your Progress

Instruction: Provide the correct SQL commands

1. Create a table Course.

2. Create a table Student.

3. Write SQL Queries to drop address column in student tables.

4. Write SQL Queries to add email and mobile columns in student tables.

5. Add the following data into C_code, C_name and duration fields of Course table
C_code C_name Duration
UG001 BCA 3
UG002 B Sc-IT 3
PG003 M Sc-IT 2

6. Add five (5) records to Student table.

7. John created a table in Mysql. Later, he found that there should have been another column in the table. Which command should he use to add another column to the table?

Question 1.
CREATE TABLE Course(
C_code varchar(15),
C_Name varchar(15),
Duration int
);

Question 2.
CREATE TABLE Student(

Stud_ID varchar(15),
Name varchar(15),
Address varchar(50),
C_Code varchar(15)
);

Question 3.
ALTER TABLE student DROP COLUMN Address;

Question 4.
ALTER TABLE Student ADD (Email varchar(20), Mobile char(14));

Question 5.

INSERT INTO course (C_code, C_Name, Duration) VALUES
('UG001', 'BCA','3'),
('UG002','B Sc-IT','3'),
('PG003', 'M Sc-IT', '2')

Question 6.
INSERT INTO student(Stud_ID, Name, C_Code, Email, Mobile) VALUES

('001', 'Ram','YS4', '[email protected]', '09090767543'),
('002', 'Jass','RE5', '[email protected]', '09078699076'),
('003', 'Jess','PT9', '[email protected]', '09568899008'),
('004', 'Kiss','CC1', '[email protected]', '09067899990'),
('005', 'Jazz','CC4', 'jazz785gmail.com', '09077788999')

Question 7. use the ALTER TABLE ADD command. This command alters a table and adds in a column with the specified data type. Using this command, you can add a column to a table after you have created the table. We can use the ALTER TABLE statement to alter our existing table and add in this new column.
Example:

Alter TABLE tablename ADD fieldname datatype(size);

ALTER TABLE Student ADD (Mobile char(14));
or
ALTER TABLE student ADD Mobile CHAR(250);

While creating a table 'Customer' Aaron forgot to set the primary key for the table. Give the statement which she should write now to set the column 'CustiD' as the primary key of the table?

Peter has already created a table ‘Hospital' as shown below. Now she wants to add a new column ‘Address' to the given table.

While creating a table named "Employee", Mr. Rishi got confused as which data type he should chose for the column "EName". Help him in choosing the right data type to store employee name. Give valid justification for the same.

Consider the table RESULT given below. Write command to insert a new row 6, "Mohan", 500, "English", 73, "Second"

Rewrite the following SQL statement after correcting error(s). Underline the corrections made.

INSERT IN STUDENT (RNO, MARKS) VALUE (5,78.5);

In a database there are two tables "Product" as shown below. Write the command to increase the Price of all the Products by 20.

Question 8. ALTER TABLE Customer ADD PRIMARY KEY (CustiD);

Question 9. ALTER TABLE Hospital ADD Address varchar(25);

Question 10. Varchar would be the suitable data type for EName column as char data type is a fixed length data type while varchar is a variable length data type. Any employee's name will be of variable length so it's advisable to choose varchar over char data type.

Question 11. INSERT INTO Result VALUES (6,"Mohan"' 500, "English", 73, "SECOND");

Question 12. INSERT IN STUDENT (RNO, MARKS) VALUE (5,78.5);

Question 13. UPDATE PRODUCT SET PRICE=PRICE + 20;

Question 14. UPDATE GYM SET BRANDNAME="Fit Trend India" where ICODE="G101";

Question 15. a. Write command to change the color of garment with code as 116 to "Orange".

b. Write command to increase the price of all XL garments by 10%

c. Write command to delete the record with GCode "116"

Reference no: EM133271869

Questions Cloud

Create job description for first ideal job upon graduation : Marketing- Entry Level Job Description - Create a job description for your first ideal job upon graduation. What education and experience in necessary
Summarizes the implication of the incarnation : Write a 2-page paper that summarizes the implication of the Incarnation that you find in your reading this week. What are the implications for you
Apply the concepts of existentialism to postmodern standards : Apply the concepts of existentialism to postmodern standards of belief. Atonement is a theological term that means to make reparations for a wrong
How the definition and tenets of gender schema : Discuss how the definition and tenets of gender schema have evolved throughout time in your life relative to your gender-specific views
Write the command to increase the price of all the products : In a database there are two tables "Product" as shown below. Write the command to increase the Price of all the Products by 20
Describe the issue, a plan to advocate : Describe the issue, a plan to advocate or how a plan was already conducted, and barriers anticipated or barriers present in the implementation
What should the stock price be currently : Three years from now, it is expected to start paying a quarterly dividend of $0.10 per share, What should the stock's price be currently
Design a course to meet the health and wellness needs : For this assignment, you will design a course to meet the health and wellness needs of the age group represented by the adult or adults you interviewed
What would you identify as the most important predictors : What would you identify as the most important predictors of engaging in violent crime and why? Associate your response with at least one theory of crime

Reviews

Write a Review

PL-SQL Programming Questions & Answers

  Create a database model

Create a database model and Submit the table creation statements for the Database Model.

  Write pl-sql procedures and functions

Write PL/SQL procedures and functions to populate and query that database

  Sql questions

Write a query to display using the employees table the EMPLOYEE_ID, FIRST_NAME, LAST_NAME and HIRE_DATE of every employee who was hired after to 1 January, 1995.

  Run the lab_03_01.sql script

Run the lab_03_01.sql script in the attached file to create the SAL_HISTORY table. Display the structure of the SAL_HISTORY table.

  Write sql queries

Write a query to display the last name, department number, and salary of any employee whose department number and salary both match the department number and salary of any employee who earns a commission.

  Explaining sql insert statement to insert new row in cds

Write down a SQL insert statement to insert new row in "CDS" table.

  Write down name of actors in ascending order

Write down actors (or actress, your choice, but not both) who have won at least two (2) Academy Awards for best actor/actress. Provide the actor name, movie title & year. Order the result by actor name."

  What is an sql injection attack

What is an SQL injection attack? Explain how it works, and what precautions must be taken to prevent SQL injection attacks.What are two advantages of encrypting data stored in the database?

  Determine resonant frequency in series rlc resonant circuit

Given the series RLC resonant circuit in the figure, operating at variable frequency, determine: The resonant frequency ω o ,  The circuit’s quality factor Q , The cut-off frequencies, f 1  & f 2  and the bandwidth BW

  Query that uses cube operator to return lineitemsum

Write summary query which uses CUBE operator to return LineItemSum (which is the sum of InvoiceLineItemAmount) group by Account(an alias for AccountDesciption).

  Query to show customers were missing for existing orders

As DBA, your manager called a meeting and asked why there are so many orders for customers that don't exist in the customer table. Write query which would shows which customers were missing for existing orders. Use a join or a subquery.

  Sql query into a relational algebra statement

Turn this SQL query into a relational algebra statement? SELECT Request.reqfor, Ordering.invamt, Ordering.invnbr, Ordering.invdat

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd