Question

Create a table tHW2_1_xxxx with the following fields and their data types (id:int, auto increment, Name:...

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.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer)
create table tHW2_1_xxxx (id int AUTOINCREMENT not null,
Name varchar(10) not null, birthday date not null, annual_salary float not null, bno varchar(8)) not null, FOREIGN KEY (bno) REFERENCES Branch(branchno));

INSERT INTO tHW2_1_xxxx (Name, birthday, annual_salary, bno)
VALUES ( 'Paul', '2008-11-11', 20000, 1);

INSERT INTO tHW2_1_xxxx (Name, birthday, annual_salary, bno)
VALUES ( 'John', '2001-10-12', 40000, 2);

INSERT INTO tHW2_1_xxxx (Name, birthday, annual_salary, bno)
VALUES ( 'Siya', '1989-09-13', 60000, 3);

INSERT INTO tHW2_1_xxxx (Name, birthday, annual_salary, bno)
VALUES ( 'Hero', '1995-08-14', 80000, 1);

INSERT INTO tHW2_1_xxxx (Name, birthday, annual_salary, bno)
VALUES ( 'Iker', '1991-07-15', 40000, 12);

Add a comment
Know the answer?
Add Answer to:
Create a table tHW2_1_xxxx with the following fields and their data types (id:int, auto increment, Name:...
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
  • -- Schema definition create table Customer (     cid   smallint not null,     name varchar(20),    ...

    -- 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...

  • Help In Database: Next comes the data entry: Make up data for your database, or find...

    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...

  • Overview: Database management plays an integral role in nearly every area of business. Databases house customer, accoun...

    Overview: Database management plays an integral role in nearly every area of business. Databases house customer, accounting, and employee data, and these different data sets must all be efficiently managed in order to make the data accessible. Companies rely on database engineers to ensure that their records are accurate, updated, and tracked in real time. This course covers structured query language (SQL) and how it can be used to manage database schemas, manipulate data, and analyze data. For your final...

  • Database Management 6. [5] Create the following table: CREATE TABLE customer ( cust_name VARCHAR(30) NOT NULL,...

    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)...

  • Given the bsg_planets table created by using the following definition query : -- CREATE TABLE `bsg_planets`...

    Given the bsg_planets table created by using the following definition query : -- CREATE TABLE `bsg_planets` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `population` bigint(20) DEFAULT NULL, `language` varchar(255) DEFAULT NULL, `capital` varchar(255) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `name` (`name`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 Insert information about the planet Mars which has a population of 2,  language as "Binary" and "Olympus Mons" as Capital, in bsg_planets. Then list the row(s), with all the information for that...

  • a database of employees that corresponds to the employee-payroll hierarchy is provided (see employees.sql to create...

    a database of employees that corresponds to the employee-payroll hierarchy is provided (see employees.sql to create the employees for a MySQL database). Write an application that allows the user to: Add employees to the employee table. Add payroll information to the appropriate table for each new employee. For example, for a salaried employee add the payroll information to the salariedEmployees table 1 is the entity-relationship diagram for the employees database Figure 1: Table relationships in the employees database [1]. Add...

  • create table candidate ( cand_id   varchar(12) primary key,   -- cand_id name       varchar(40)           --...

    create table candidate ( cand_id   varchar(12) primary key,   -- cand_id name       varchar(40)           -- cand_nm ); create table contributor ( contbr_id   integer primary key, name       varchar(40),           -- contbr_nm city     varchar(40),           -- contbr_city state       varchar(40),           -- contbr_st zip       varchar(20),           -- contbr_zip employer   varchar(60),           -- contbr_employer occupation   varchar(40)           -- contbr_occupation ); create table contribution ( contb_id   integer primary key, cand_id   varchar(12),           --...

  • SQL Query Question: I have a database with the tables below, data has also been aded...

    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...

  • Database concepts Find the names and ids of the students who have taken at most one...

    Database concepts Find the names and ids of the students who have taken at most one course in the Spring 2010 semester. Notice, at most one means one or zero. So, the answer should include students who did not take any course during that semester The data: create table classroom     (building       varchar(15),      room_number        varchar(7),      capacity       numeric(4,0),      primary key (building, room_number)     ); create table department     (dept_name      varchar(20),      building       varchar(15),      budget      numeric(12,2) check (budget > 0),      primary key (dept_name)     ); create...

  • Based on the CREATE TABLE statements, make an ER model of the database. Give suitable names...

    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...

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