Creating and Deleting Database Tables with SQL
________________________________
Creating and Deleting Tables
________________________________
CREATE TABLE F (
F_cod INT(11) NOT NULL PRIMARY KEY,
F_nome CHAR(50) NOT NULL,
F_status INT NOT NULL,
F_cidade CHAR(25) NOT NULL)
CREATE TABLE P (
P_cod INT(11) NOT NULL PRIMARY KEY,
P_nome CHAR(50) NOT NULL,
P_cor CHAR(15) NOT NULL,
P_preco FLOAT(10,2) NOT NULL,
P_cidade CHAR(25) NOT NULL )
CREATE TABLE FP (
F_cod INT(11) NOT NULL,
P_cod INT(11) NOT NULL,
qtde INT NOT NULL,
CONSTRAINT FOREIGN KEY (F_cod)
SQL Database Schema: Doctors, Patients, and Care
SQL Database Schema for Medical Records
Creating Tables
SQL code to create the Medico
(Doctor), Paciente
(Patient), and Atencion
(Care) tables:
CREATE TABLE Medico (
rut VARCHAR2(20) NOT NULL,
nombre VARCHAR2(90) NOT NULL,
apellidos VARCHAR2(80) NOT NULL,
email VARCHAR2(70),
sueldo NUMBER(20) NOT NULL,
CONSTRAINT medico_pk PRIMARY KEY(rut)
);
CREATE TABLE Paciente (
id NUMBER(20) NOT NULL,
rut VARCHAR2(15) NOT NULL,
nombre_completo VARCHAR2(200) NOT NULL,
fecha_nacimiento DATE NOT NULL,
Read More
Francisco Javier Bahena Cisneros: Profile
Francisco Javier Bahena Cisneros
Francisco Javier Bahena Cisneros
Francisco Javier Bahena Cisneros Francisco Javier Bahena Cisneros Francisco Javier Bahena Cisneros Francisco Javier Bahena Cisneros.
Francisco Javier Bahena Cisneros Francisco Javier Bahena Cisneros Francisco Javier Bahena Cisneros.
Francisco Javier Bahena Cisneros Francisco Javier Bahena Cisneros Francisco Javier Bahena Cisneros.
Francisco Javier Bahena Cisneros Francisco Javier Bahena Cisneros Francisco Javier Bahena Cisneros.
Francisco
Read MoreUses and Gratifications Theory: Media Consumption Motives & Effects
Uses & Gratifications
What do people do with media? Uses & gratifications shifts the focus to understanding why people use media. It combines insights from different fields.
The starting point is the assumption that we consume media to satisfy needs. The focus is on analyzing these needs and the direct impact media has.
It assumes the audience is relatively active. The background is essential to understand people’s choice of media. Media impact is limited by individual differences, motivation,
Read MoreSQL Queries and Table Operations for Video Game Database
Basic Aggregate Functions
Count (Cuenta)
SELECT COUNT(*) FROM juegos;
Min (Valor Minimo)
SELECT MIN(Precio) FROM Juegos;
Max (Valor Maximo)
SELECT MAX(Precio) FROM juegos;
Avg (Promedio)
SELECT AVG(Precio) FROM juegos;
Sum (Suma)
SELECT SUM(Precio) FROM Juegos WHERE Distribuidor = 'Blizzard';
Subgroups (Precio o Genero)
SELECT nom FROM juegos WHERE precio = (SELECT MIN(precio) FROM juegos);
SELECT genero, COUNT(*)
Table Creation and Modification
CREATE TABLE juegos (codjue int, Nom VARCHAR2(