Question

this is sql developer question I just need the format of how to answer question! Create...

  1. this is sql developer question I just need the format of how to answer question!
  2. Create sequences (2) that can be used to number the member ID and group ID values starting with 3 (since you already have 1 and 2).
  3. Write an INSERT statement that adds another row to the Groups table, make up a group name. Use the NEXTVAL pseudo column to get the value for the next group ID from the sequence that you created in #5. Then, write a SELECT statement that gets all of the data for all of the rows in the Groups table to make sure your sequence worked correctly.
  4. Write an ALTER TABLE statement that adds two new columns to the Members table: one column for annual dues that provides for three digits to the left of the decimal point and two to the right; and one column for the payment date. The annual dues column should have a default value of 52.50.
  5. Write an ALTER TABLE statement that modifies the Groups table so the group name in each row has to be unique. Then, re-run the INSERT statement that you used in #6 to make sure this works.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

1)

CREATE SEQUENCE seq_1
START WITH 3
INCREMENT BY 1
MAXVALUE 999
CYCLE;

2)

INSERT INTO Groups(GroupID, GroupName) VALUES (seq_1.nextval, "Sample Group");

NOTE: Since you have not mentioned the table structure, I am inserting dummy row into unknown columns.

SELECT * FROM Groups;

3)

ALTER TABLE Members ADD AnnualDues DECIMAL(3, 2) default 52.50,

ADD PaymentDate DATE;

4)

ALTER TABLE Groups ADD UNIQUE(GroupName);

INSERT INTO Groups(GroupID, GroupName) VALUES (seq_1.nextval, "Sample Group");

Add a comment
Know the answer?
Add Answer to:
this is sql developer question I just need the format of how to answer question! Create...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • SQL Homework exercises: 1. Write INSERT statements that add two rows to the Members table for...

    SQL Homework exercises: 1. Write INSERT statements that add two rows to the Members table for member IDs 1 and 2, two rows to the Groups table for group IDs 1 and 2, and three rows to the Group_Membership table: one row for member 1 and group 2; one for member 2 and group 1; and one for member 2 and group 2. Then, write a SELECT statement that joins the three tables and retrieves the group name, member last...

  • 2. Write a script that implements the following design: In the Downloads table, the user_id and...

    2. Write a script that implements the following design: In the Downloads table, the user_id and product_id columns are the foreign keys. Create these tables in the ex schema. Create the sequences for the user_id, download_id, and product_id columns. Include a PL/SQL script to drop the table or sequence if it already exists. Include any indexes that you think are necessary. 3. Write a script that adds rows to the database that you created in exercise 2. Add two rows...

  • 1. Write an INSERT statement that adds this row to the Categories table: CategoryName: Brass Code...

    1. Write an INSERT statement that adds this row to the Categories table: CategoryName: Brass Code the INSERT statement so SQL Server automatically generates the value for the CategoryID column. 2. Write an UPDATE statement that modifies the row you just added to the Categories table. This statement should change the Category Name column to “Woodwinds”, and it should use the CategoryID column to identify the row. 3.Write an INSERT statement that adds this row to the Products table: ProductID:...

  • 3. Write a script that adds rows to the database that you created in exercise 2....

    3. Write a script that adds rows to the database that you created in exercise 2. Add two rows to the Users and Products tables. Add three rows to the Downloads table: one row for user 1 and product 2; one row for user 2 and product 1; and one row for user 2 and product 2. Use the SYSDATE function to insert the current date into the download_date column. Use the sequences created in the previous exercise to get...

  • I need help with certain questions. Please. 18. 4 points For each Rental, list the Rental...

    I need help with certain questions. Please. 18. 4 points For each Rental, list the Rental ID, Rental date, customer ID, customer first name, customer last name, and count of disks rented; sort by Rental ID. Show the Rental date formatted as ‘mm-dd-yyyy.’ Hint: use a GROUP BY clause. 19. 4 points List the disk ID, title name, rating, format description, and fee amount for all copies rented in Rental 3; sort by disk ID. Show the fee amount formatted...

  • l want to insert statement inside the table student on My SQL program the latest version...

    l want to insert statement inside the table student on My SQL program the latest version but there is an error l am not able determine how to applied or insert a row as: Steps In each of these queries you’re shown the columns to display in your result. Make your column headers look exactly like the example shown. All these queries use the Starter database. 0. Even if you downloaded it for the previous assignment, to make sure you...

  • I need to write an SQL statement to run this query: SALES has the following column...

    I need to write an SQL statement to run this query: SALES has the following column names: vendorid, name, upc, move, price, qty, year, store the table name is SALES... the sales is not a column in the SALES so it needs to be created in the query with the formula as well. QUESTION BELOW: Query 4: Return the vendor id, vendor name, product UPC code, move, and sales (price * move/qty) for each product sold by store 100 in...

  • Create the database and tables for the database. Show all SQL statements. Include primary and foreign...

    Create the database and tables for the database. Show all SQL statements. Include primary and foreign keys. Insert data into each table. Show select statements and display the output of each table. Note:Student’s name must be inserted into table as part of the data! Perform the SQL below: Query one table and use WHERE to filter the results. The SELECT clause should have a column list, not an asterisk (*). State the purpose of the query; show the query and...

  • 1. List the numbers of the boxes below and their contents to show how the binary...

    1. List the numbers of the boxes below and their contents to show how the binary tree below appears in memory when stored without points using a block of contiguous memory cells. Ferb          /    \    Isabella   Perry     /           \   Candace      Phineas ____  ____ ____ ____ ____ ____ ____ 1      2    3     4     5     6     7 2. Translate this query for the above database into SQL: For which trip was Rudolf the leader of Santa's team? SELECT Name FROM Assignment, Reindeer WHERE Reindeer.ID = Assignment.ID and Trip <> '1932';...

  • Using SQL*Plus on OMEGA, access the tables you created in Project 2 and complete the following...

    Using SQL*Plus on OMEGA, access the tables you created in Project 2 and complete the following SQL transactions. Log your statements and results by spooling your file (with echo on). Directions for creating and running SQL files are available in the Assignments and Exams page in Blackboard (in the Project 2 group of files). All column headings must show in their entirety. Be sure to include a cover sheet with your full name, section, and date submitted. 19. 4 points...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT