Question

In: Computer Science

Create a Database from blank (scratch) for a manager and name it. Create and design a...

Create a Database from blank (scratch) for a manager and name it. Create and design a table and name it. For each fields click and choose proper a data type such as short text and name the field. Make at least three fields. Enter your records. Make sure to add your name as a record.

Similarly create two more tables. By design tool, make a relationship between each of two tables at a time and drag a primary key one table to a secondary key of another table. For example one to one, one to many, many to one or many to many)

Run at least 5 queries of different important tasks on the data base

For this question I was given no data

Solutions

Expert Solution

create table manager(m_id int, m_name char(10), dept_name char(20) , emp_id int);

insert into manager values ( 1, 'Tom', 'computer',101);
insert into manager values ( 2, 'Harry', 'economics',102);
insert into manager values ( 3, 'France', 'biology', 103);

create table employee( emp_id int, emp_name char(10), m_id int, dept_name char(20), salary decimal,job_name char(20) ) ;


insert into employee values( 101, 'John', 1, 'computer', 20000.00, 'ANALYST ');
insert into employee values( 102, 'Marry', 2, 'economics', 55000.00,'ANALYST ');
insert into employee values( 103, 'Ram', 3, 'biology', 40000.00,'SALESMAN');
insert into employee values( 102, 'Geeta', 2, 'economics', 30000.00,'CLERK ');

create table department(dept_id int, dept_name char(20));


insert into department values ( 201, 'economics');
insert into department values ( 202, 'computer');
insert into department values ( 203, 'biology');

/* display names of all employees who work for manager 'Harry' */

select e.emp_name from employee as e
join manager as m on m.m_id = e.m_id
where m.m_name ='Harry';

/* display names of managers from all departments */

select m.m_name from manager as m
join department as d on d.dept_name = m.dept_name;

/* display information of all employees whose salary is between 10000 and 40000 */

select emp_id, emp_name, salary from employee as e
where salary BETWEEN 10000 AND 40000;

/* SQL to list the manager no, name and the name of employees working for those managers in ascending order on manager id.*/

SELECT m.m_id, m_name, e.emp_name
  
FROM manager m,employee e
WHERE m.m_id = e.m_id
ORDER BY m.m_id ASC;

/* list list emp number ,name ,job, department in which employee works and job type ='analyst' */

select e.emp_id, e.emp_name, e.dept_name, e.job_name
from employee as e
join manager as m on m.m_id=e.m_id
join department as d on d.dept_name= e.dept_name
where job_name = 'ANALYST';



Related Solutions

Database exercise: inpatient cases Create database using name RUMKIT Create tables below in that database patient(idPatient,...
Database exercise: inpatient cases Create database using name RUMKIT Create tables below in that database patient(idPatient, fullName, biologicalMother, birthdate, address) doctor(idDr, fullName, specialization, consulRates) inpatient(idPatient, entryTime, outTime, idDr, idRoom). Please make entryTime as column that is going to be filled automatically when care record is being add room(idRoom, roomName, cost) fill the data above to each table Create sql query and relational algebra expressions for the query Please give me detailed answer so I could learn from it. Thank you...
1.Create a Database in Access with the information The database must include: Database name: Monaco Enterprise  Mark...
1.Create a Database in Access with the information The database must include: Database name: Monaco Enterprise  Mark Johnson #87451 Table name: Contacts Delete the Primary key. Fields name and data type are (remember to choose the data type): Field Name Data Types Employee Name Short text Name Short text Last Name Short Text Work Yes/No 2.Go to the “Datasheet View” and enter the data. * Remember to save the table. 3.Move the last name field after the employee name. 4.The (data)...
C++ Create an ArrayBag template class from scratch. This will require you to create two files:...
C++ Create an ArrayBag template class from scratch. This will require you to create two files: ArrayBag.hpp for the interface and ArrayBag.cpp for the implementation. The ArrayBag class must contain the following protected members: static const int DEFAULT_CAPACITY = 200; // max size of items_ ItemType items_[DEFAULT_CAPACITY]; // items in the array bag int item_count_; // Current count of items in bag /** @param target to be found in items_ @return either the index target in the array items_ or...
Database Design CIW State_Capitals Physical Database Create primary and secondary keys for the attached unfinished physical...
Database Design CIW State_Capitals Physical Database Create primary and secondary keys for the attached unfinished physical database design. CREATE DATABASE STATE_CAPITALS; GO USE STATE_CAPITALS; GO CREATE TABLE Country( Country_Code varchar(10) NOT NULL, Country_Name varchar(50) NOT NULL, Population int NOT NULL, Country_Size float NOT NULL ) GO CREATE TABLE Region( Country_Code varchar(10) NOT NULL, Region_Code varchar(10) NOT NULL, Region_Name varchar(50) NOT NULL ) GO CREATE TABLE State( Region_Code varchar(10) NOT NULL, State_Code char(2) NOT NULL, State_Name varchar(50) NOT NULL, Date_of_Statehood int...
Database __________ which is the logical design of the database, and the database _______ which is...
Database __________ which is the logical design of the database, and the database _______ which is a snapshot of the data in the database at a given instant in time. a) Instance, Schema b) Relation, Schema c) Relation, Domain d) Schema, Instance
Create a database and design an ER diagram for the given question. Must link the related...
Create a database and design an ER diagram for the given question. Must link the related tables then implement the design using MySQL. Insert at least 5 records. Ensure that the data to be added are related to other tables. Follow this format in creating the database and table: Database format: databasename_yourname Table format: tablename_yourname QUESTION: Company ABC has the following business rules. A department employs many employees, but each employee is employed by only one department. A division operates...
Create a database design with the following rules. List down all the entities and attributes and...
Create a database design with the following rules. List down all the entities and attributes and draw out the relationships. List all the business rules. 1. A person can have multiple accounts (Track individual accounts, Trusts, IRA, 401k, HSA, etc) a. Not all accounts must be through brokerage 2. Multiple brokerages (Fidelity, Vanguard, ect) a. Multiple accounts with different brokerages b. Multiple types of accounts allowed at each broker 3. Categorization of investments (Large Cap, mid cap, small cap, Bonds...
Design Of Database System Course True or False 1. In MySQL, it is possible to create...
Design Of Database System Course True or False 1. In MySQL, it is possible to create a table by using the definition of another table. 2. {(t.lname) | s ∈ Student, s.stuId = t.stuId, t ∉ Graduate_Student, s.major = ‘CS’} is a safe relational calculus expression. 3. In SQL, it is possible to insert multiple rows into a table using a single INSERT statement.
Create a database with two tables as follows:- Students - StudentID, Name, Program FeePayment - StudentID,...
Create a database with two tables as follows:- Students - StudentID, Name, Program FeePayment - StudentID, Date, Description, Amount 1. Create a stored procedure that receives all the details of a student including fees and proceeds to insert insert the student details into the student details and the fee payment into the FeePayment table. All the operations should be done within a single transaction in a stored procedure. Note that the stored procedure works like a function that receives parameters....
True or False: Logical database design is the process of modifying the physical database design to...
True or False: Logical database design is the process of modifying the physical database design to improve performance. The two major logical database design techniques are conversion of E-R diagrams to relational tables and data normalization. Multivalued attributes are not permitted in unnormalized data. A many-to-many binary relationship in an E-R diagram requires the creation of a total of three tables in a relational database. A one-to-one unary relationship in an E-R diagram requires the creation of a total of...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT