text
stringlengths
6
9.38M
--База данных - Банк --База данных включает в себя 4 вспомогательных таблиц: клиенты, работники, место, тип операции. И главной, включающей в себя информацию о каждой операции. CREATE DATABASE bank; GRANT ALL PRIVILEGES ON DATABASE bank TO defygee; --///////////////////////////////////////////////////////////////...
DROP TABLE IF EXISTS organisations CASCADE; CREATE TABLE organisations ( id SERIAL PRIMARY KEY NOT NULL, name VARCHAR(255) NOT NULL );
-- phpMyAdmin SQL Dump -- version 4.1.6 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Jun 16, 2016 at 08:32 AM -- Server version: 5.6.16 -- PHP Version: 5.5.9 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /...
-- ---------------------------------------------------------------------------- -- -- Event store tables schema. -- -- ---------------------------------------------------------------------------- CREATE TABLE "projector_state" ( "id" varchar(500) NOT NULL, "created_at" timestamp NOT NULL DEFAULT now(), "u...
drop database if exists wallethub; create database if not exists wallethub; use wallethub; create table votes ( name char(10), votes int ); insert into votes values ('smith',10), ('jones',15), ('white',20), ('black',40), ('green',50), ('brown',20); set @rankorder=0; select @rankorder:=@rankorder+1 as rankorder, name,...
DROP DATABASE IF EXISTS vk2; CREATE DATABASE vk2; USE vk2; DROP TABLE IF EXISTS users; CREATE TABLE users ( id SERIAL PRIMARY KEY, -- SERIAL = BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE firstname VARCHAR(50), lastname VARCHAR(50) COMMENT 'Фамиль', -- COMMENT на случай, если имя неочевидное email VARCH...
CREATE TABLE GameRankings ( GameRankingId UNIQUEIDENTIFIER NOT NULL CONSTRAINT DF_GameRanking_Id DEFAULT NEWSEQUENTIALID(), GameConsoleId UNIQUEIDENTIFIER NOT NULL, GameId UNIQUEIDENTIFIER NOT NULL, GameRanking INT, GameRankingName VARCHAR(255), CreatedDate DATETIME2, CreatedBy VARCHAR(255), ...
SELECT p.player_id, name, pl.team_id as team_id, team_name, -- count(*) as game_count, sum(runs)/sum(inning)*5 as era, (sum(hit)+sum(four_ball))/sum(inning) as WHIP, sum(strike_out)/sum(inning)*5 as strike_avg, sum(inning) as inning, sum(pa) as pa, sum(hit) as hit, sum(homerun) as homerun, sum...
--1. List the following details of each employee: employee number, last name, first name, gender, and salary. SELECT employees.emp_no, employees.last_name, employees.first_name, employees.gender, salaries.salary FROM employees JOIN salaries ON employees.emp_no = salaries.emp_no --2. List employees who were ...
/* Navicat MySQL Data Transfer Source Server : local Source Server Version : 100116 Source Host : localhost:3306 Source Database : bd_sportingcristal Target Server Type : MYSQL Target Server Version : 100116 File Encoding : 65001 Date: 2017-06-09 23:58:35 */ SET FOREIGN_KEY_CHECKS...
CREATE TABLE [geo].[Ciudades] ( [Id] INT NOT NULL, [Id_Departamento] INT NOT NULL, [Codigo] VARCHAR (10) NOT NULL, [Nombre] VARCHAR (50) NOT NULL, [Longitud] DECIMAL (18, 15) NULL, [Latitud] ...
/* SQLite Syntax Schema: Movie ( mID, title, year, director ) English: There is a movie with ID number mID, a title, a release year, and a director. Reviewer ( rID, name ) English: The reviewer with ID number rID has a certain name. Rating ( rID, mID, stars, ratingDate ) English: The reviewer rID gave the movie mID ...
/* Long names of days, starting with 0 = Sunday * as per the Sqlite strftime function. */ CREATE TABLE v1_DimDay ( DayId INTEGER PRIMARY KEY , DayName TEXT NOT NULL , UNIQUE(DayName)); CREATE TABLE v1_User ( UserId INTEGER PRIMARY ...
/* PROCEDURES DO BANCO DE DADOS GOODEYES **ALTERAR************************************************************************ */ /* -- LOGIN*/ DELIMITER $$ drop procedure if exists pa_alterarLogin $$ create Procedure pa_alterarLogin ( $email varchar (60), $senha varchar (8), $nivel_acesso int ) main: begin upd...
# several way to comment in mysql # using --, # and /*comment*/ # create database/schema CREATE SCHEMA IF NOT EXISTS godking; # DISPLAY ALL DATABASES IN MYSQL SHOW DATABASES; USE godking; -- table -- create table CREATE TABLE IF NOT EXISTS user ( id INT AUTO_INCREMENT, name VARCHAR(255) NOT NULL, age...
delete from user_book_flight; delete from booking; delete from booking_passenger; delete from passenger; alter table passenger auto_increment = 1;
use hackerrank_top_competitors; insert into difficulty (difficulty_level, score) values (1,20), (2,30), (3,40), (4,60), (5,80), (6,100), (7,120) ;
/* В базе данных shop и sample присутствуют одни и те же таблицы, учебной базы данных. Переместите запись id = 1 из таблицы shop.users в таблицу sample.users. Используйте транзакции.*/ use sample; start transaction; insert into sample.users (id, name) select id, name from shop.users where shop.users.id = 1; --...
create sequence id_sequence_crypt start 100 increment 10; create table sensor_vals (id int8 not null, uuid varchar(255), primary key (id));
DROP DATABASE IF EXISTS test; create database test; use test; drop table if exists item; drop table if exists category; drop table if exists customer; drop table if exists ordered; drop table if exists ordered_default; create table item ( code SERIAL primary key, category_code integer, name ...
CREATE DATABASE yetigave; USE yetigave; CREATE TABLE categories ( id INT AUTO_INCREMENT PRIMARY KEY, category_name CHAR(128) ); CREATE UNIQUE INDEX category_name ON categories(category_name); CREATE TABLE lots ( id INT AUTO_INCREMENT PRIMARY KEY, date_of_creation TIMESTAMP, lot_title VARCHAR(60), descrip...
-- phpMyAdmin SQL Dump -- version 4.5.4.1deb2ubuntu2.1 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Nov 24, 2018 at 08:06 AM -- Server version: 10.0.36-MariaDB-0ubuntu0.16.04.1 -- PHP Version: 7.2.5-1+ubuntu16.04.1+deb.sury.org+1 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00...
-- phpMyAdmin SQL Dump -- version 4.9.1 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Jul 07, 2021 at 12:38 PM -- Server version: 10.4.8-MariaDB -- PHP Version: 7.3.11 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD...
CREATE TABLE word( id BIGINT PRIMARY KEY auto_increment NOT NULL, wordname VARCHAR(20), worddesc VARCHAR(20) ); CREATE TABLE users( user_id BIGINT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(64), score INT ); CREATE TABLE userattemts( id BIGINT AUTO_INCREMENT PRIMARY KEY, user_id BIGINT NOT NULL, ...
CREATE DATABASE `fujii_bot` DEFAULT CHARACTER SET utf8; GRANT ALL PRIVILEGES ON fujii_bot.* TO 'fujii'@'localhost' IDENTIFIED BY 'hoge' WITH GRANT OPTION; FLUSH PRIVILEGES; /* user */ CREATE TABLE `user`( `user_id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, `mid` VARCHAR(64) NOT NULL COMMENT 'LINE FROM', ...
-- User email must be unique ALTER TABLE USERS ADD CONSTRAINT UQ_USERS_EMAIL UNIQUE (EMAIL); -- @rollback ALTER TABLE USERS DROP CONSTRAINT IF EXISTS UQ_USERS_EMAIL; -- @mysql-rollback -- ALTER TABLE USERS DROP CONSTRAINT UQ_USERS_EMAIL;
IF (OBJECT_ID('dbo.FK_ComputerEmployee', 'F') IS NOT NULL) BEGIN ALTER TABLE dbo.EmployeeComputer DROP CONSTRAINT FK_ComputerEmployee END IF (OBJECT_ID('dbo.FK_EmployeeComp', 'F') IS NOT NULL) BEGIN ALTER TABLE dbo.EmployeeComputer DROP CONSTRAINT FK_EmployeeComp END IF (OBJECT_ID('dbo.FK_TrainingProgram', '...
 DO $$ BEGIN IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20190809125322_v1.17') THEN ALTER TABLE iml_medicines ADD is_from_license boolean NOT NULL DEFAULT FALSE; END IF; END $$; DO $$ BEGIN IF NOT EXISTS(SELECT 1 FROM "__EFMigrationsHistory" WHERE "MigrationId" = '20190...
-- 元日 一月一日 CREATE OR REPLACE FUNCTION holidays_in_japan.IS_NEW_YEARS_DAY(d DATE) AS ( EXTRACT(DAYOFYEAR FROM d) = 1 );
-- Create a new table called 'TableName' in schema 'SchemaName' -- Drop the table if it already exists -- Create the table in the specified schema CREATE TABLE player ( id INT(11) NOT NULL Auto_INCREMENT PRIMARY KEY , plyer_name VARCHAR(50) NOT NULL, nation VARCHAR(30) NOT NULL, team VARCHAR(30) NOT NU...
-- -- PostgreSQL database dump -- -- Dumped from database version 10.4 -- Dumped by pg_dump version 10.4 -- Started on 2018-08-04 04:47:50 SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SELECT pg_catalo...
CREATE DATABASE IF NOT EXISTS registro4; USE registro4; CREATE TABLE users( username VARCHAR(255), password VARCHAR(255), id VARCHAR(255), PRIMARY KEY(id) ); CREATE TABLE students( name VARCHAR(255), last VARCHAR(255), id VARCHAR(255), course VARCHAR(255), PRIMARY KEY(id) ); CREATE TABLE pr...
Use MonkeyUniv -- (1) Listado con la cantidad de cursos. Select count(*) as 'Cantidad de cursos' from Cursos -- 2 Listado con la cantidad de usuarios. Select count(*) as 'Cantidad de Usuarios' from Usuarios -- (3) Listado con el promedio de costo de certificación de los cursos. Select avg(Cursos.CostoCertificaci...
ALTER TABLE employee ADD company_code VARCHAR(255) AFTER employee_code; UPDATE employee SET company_code = ( SELECT company_code FROM company ); SELECT employee.company_code, company.company_name, employee.employee_code, employee.employee_name, ( SELECT position.position_name FROM position WHERE employ...
Insert into FIRST_LANGUAGE values (1101,'Noun',12,21,2,3,'ads','tas','tus'); Insert into FIRST_LANGUAGE values (1102,'Noun',13,22,1,4,'fds','weq','ax'); Insert into FIRST_LANGUAGE values (1103,'Verb',14,23,2,3,'pitj','morder','bra'); INSERT INTO TRANSCRIPTION(ID, ID_FIRST, ID_GERMAN,KNOWLEDGE_GERWORD, KNOWLEDGE_T...
-- -------------------------------------------------------- -- -- Estrutura da tabela `tb_lancto_contabil` -- CREATE TABLE `tb_lancto_contabil` ( `Codigo` int(11) NOT NULL, `Pessoa` int(11) NOT NULL, `CentroCusto` int(11) NOT NULL, `Credito` int(11) NOT NULL, `Debito` int(11) NOT NULL, `Valor` double NOT...
CREATE ROLE career; ALTER ROLE career WITH SUPERUSER INHERIT CREATEROLE CREATEDB LOGIN NOREPLICATION NOBYPASSRLS PASSWORD 'md5d7980ace5b59ea073a4c25bd767b9c8d'; CREATE DATABASE career WITH TEMPLATE = template0 OWNER = postgres; GRANT ALL ON DATABASE career TO career;
-- Пусть задан некоторый пользователь. -- Из всех друзей этого пользователя найдите человека, который больше всех общался с нашим пользователем. SELECT CONCAT( 'Пользователь ', first_name, ' ', last_name, ' ', 'Больше всех общался с пользователем ', (SELECT first_name, last_name FROM profiles WHERE us...
USE homestead; INSERT INTO document_types (id,namespace, document_type, lang_ua) VALUES (1,'tender', 'notice', 'Повідомлення про закупівлю'), (2,'tender', 'biddingDocuments', 'Документи закупівлі'), (3,'tender', 'technicalSpecifications', 'Технічні специфікації'), (4,'tender', 'evaluationCriteria', 'Критерії...
CREATE TABLE person ( id INT NOT NULL AUTO_INCREMENT, name VARCHAR(250), birth_date LONG(250) ); CREATE TABLE users ( id INT NOT NULL AUTO_INCREMENT, login VARCHAR(250), password VARCHAR(250) )
SELECT * FROM Sailors; SELECT Sailors.A FROM Sailors; SELECT Boats.F, Boats.D FROM Boats; SELECT Reserves.G, Reserves.H FROM Reserves; SELECT * FROM Sailors WHERE Sailors.B >= Sailors.C; SELECT Sailors.A FROM Sailors WHERE Sailors.B >= Sailors.C SELECT Sailors.A FROM Sailors WHERE Sailors.B >= Sailors.C AND Sailors.B <...
-- phpMyAdmin SQL Dump -- version 4.3.11 -- http://www.phpmyadmin.net -- -- Vært: 127.0.0.1 -- Genereringstid: 02. 10 2019 kl. 19:36:45 -- Serverversion: 5.6.24 -- PHP-version: 5.6.8 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*...
CREATE SEQUENCE mailchimp_id_seq; CREATE TABLE public.mailchimp ( id smallint NOT NULL DEFAULT nextval('mailchimp_id_seq'), first_name character varying(255) DEFAULT NULL, last_name character varying(255) DEFAULT NULL, email character varying(255) DEFAULT NULL UNIQUE, CONSTRAINT user_pkey PRIMARY KEY (id), CO...
CREATE TABLE transaction ( uuid UUID NOT NULL, from_account_id UUID, to_account_id UUID NOT NULL, amount BIGINT(20) NOT NULL, status ENUM('NEW', 'FAILED', 'COMPLETED') NOT NULL, type ENUM('CREDIT', 'TRANSFER') NOT NULL, PRIMARY KEY (uuid), CONSTRAINT fk_from_account_id FOREIGN KEY (from_...
CREATE SEQUENCE seq_user_transaction_id AS BIGINT START WITH 1; CREATE TABLE user_transaction ( id BIGINT PRIMARY KEY, type INTEGER NOT NULL, external_id VARCHAR(36) NOT NULL, account_id BIGINT, amount_value NUMERIC(16, 2) NOT NULL, amount_currency VARCHAR(3) NOT NULL ); CREATE UNIQUE INDEX idx_user_trans...
# Write your MySQL query statement below # product_name in lowercase without leading or trailing white spaces. # sale_date in the format ('YYYY-MM'). # total the number of times the product was sold in this month. SELECT LOWER(TRIM(product_name)) AS product_name, DATE_FORMAT(sale_date, '%Y-%m') AS sale_date, COUNT(*) ...
USE sakila; -- 1a. Display the first and last names of all the actors from the table actor. SELECT first_name, last_name from actor; -- 1b. Display the first and last name of each actor in a single column in upper case letters. Name the column Actor Name SELECT CONCAT(first_name, ' ', last_name) as 'ACTOR NAME' fro...
create table devcode_transactions ( id bigint not null auto_increment, player_id bigint not null, event_type character varying(50) not null, level bigint not null, authorization_code character varying(46),...
CREATE TABLE visitors ( Name varchar(255), ContactInfo varchar(255) );
DROP TABLE IF EXISTS `quotes`; CREATE TABLE `quotes` ( `id` int NOT NULL AUTO_INCREMENT, `quote` VARCHAR(500) NOT NULL, `author` VARCHAR(300) NOT NULL, `likes` INT, PRIMARY KEY (`id`) ) ENGINE = InnoDB DEFAULT CHARSET = utf8; INSERT INTO `quotes` (quote, author) VALUES ('La vie cest cool', 'Benito'), ('Le front c...
use employees; select emp_no,birth_date,first_name,last_name,gender,hire_date from employees order by hire_date limit 0,1; UPDATE salaries,employees SET salaries.salary=salaries.salary+1 WHERE salaries.emp_no=employees.emp_no and employees.gender="M"; DELETE dept_emp FROM employees,dept_emp WHERE employees.emp_no=de...
CREATE TABLE language ( language_id integer NOT NULL PRIMARY KEY, language_name varchar(30) );
/* Warnings: - Added the required column `entityId` to the `EntityLog` table without a default value. This is not possible if the table is not empty. */ -- AlterTable ALTER TABLE "EntityLog" ADD COLUMN "entityId" TEXT NOT NULL;
col status for a10 SELECT vh.inst_id, vh.sid locking_sid,vs.serial#, vs.status status, vs.program program_holding, vw.sid waiter_sid, vsw.program program_waiting FROM gv$lock vh, gv$lock vw, gv$session vs, gv$session vsw WHERE (vh.id1, vh.id2) IN (SELECT id1, id2 FROM gv$lock WHERE request = 0 ...
ALTER TABLE behavior_group_action ADD COLUMN position INTEGER NOT NULL DEFAULT 0; -- The default value is required to migrate existing actions. ALTER TABLE behavior_group_action ALTER COLUMN position DROP DEFAULT; -- Migration done, we can drop the default value.
CREATE TABLE inbound_message ( message_id NUMBER(19,0), message_body VARCHAR2(200), received_date DATE ) / CREATE SEQUENCE inbound_message_seq START WITH 1 INCREMENT BY 1 NOCACHE NOCYCLE / CREATE TABLE tower ( tower_id NUMBER(19,0), VALUE NUMBER, POSITION NUMBER, VOLUME NUMBER ) / ...
select a.student_no, a.student_name, a.plan_submit_dept, a.adjust_start_time, a.adjust_end_time, a.track_sale, a.lesson_status, a.fd_submit_time, a.final_feedback, a.content, a.subject_name, a.plan_submit_sale, a.lesson_plan_id from( select lp.lesson_plan_id, s.student_no, ...
/* import globalfirepower.csv Note that you can wrap column names around quotes to handle spaces: select 'Total Aircraft Strength' from globalfirepower limit 5; Also, you can use mysqlworkbench to alter table column names. Right-click the table and click 'alter table'. */ -- altering original table: use Miscellaneous...
update levels set bonus_id = 16 where level = 10; update levels set bonus_id = 17 where level = 11; update levels set bonus_id = 18 where level = 12; update levels set bonus_id = 19 where level = 13; update levels set bonus_id = 20 where level = 14; update levels set bonus_id = 21 where level = 15; update levels ...
CREATE TABLE "FileStatus" ( "FileStatusId" uuid NOT NULL, "FileId" uuid NOT NULL, "StatusType" text NOT NULL, "Value" text NOT NULL, "CreatedDatetime" timestamp with time zone not null, CONSTRAINT "FileStatus_pkey" PRIMARY KEY ("FileStatusId"), CONSTRAINT "FileStatus_File_fkey" FOREIGN KEY ...
INVALID TEST Renaming views for Apache Derby is not supported by Liquibase community: https://docs.liquibase.com/change-types/community/rename-view.html
USE employee_tracker_DB; INSERT INTO department (name) VALUES ('Sales'), ('Engineering'),('Finance'),('Legal'),('Marketing'); INSERT INTO role (title,salary, department_id) VALUES ('Sales Lead',90000,1),('Sales Representative',70000,1), ('Lead Engineer',100000,2),('Software Engineer',90000,2), ('Accountant',60000,3),...
-- phpMyAdmin SQL Dump -- version 5.0.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Apr 14, 2021 at 10:38 AM -- Server version: 10.4.17-MariaDB -- PHP Version: 8.0.0 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIEN...
-- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Хост: 127.0.0.1 -- Время создания: Май 14 2020 г., 22:44 -- Версия сервера: 10.4.11-MariaDB -- Версия PHP: 7.4.4 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@C...
\copy customer FROM '../tpch/tables/customer.tbl' WITH DELIMITER AS '|'; \copy lineitem FROM '../tpch/tables/lineitem.tbl' WITH DELIMITER AS '|'; \copy nation FROM '../tpch/tables/nation.tbl' WITH DELIMITER AS '|'; \copy orders FROM '../tpch/tables/orders.tbl' WITH DELIMITER AS '|'; \copy part FROM '../tpch/tables/part...
-- phpMyAdmin SQL Dump -- version 4.4.15.10 -- https://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: 2017-07-04 16:25:02 -- 服务器版本: 5.5.52-MariaDB -- PHP Version: 5.4.16 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /...
CREATE TABLE IF NOT EXISTS customers ( id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY, customerFirstName VARCHAR(50) DEFAULT NULL, customerLastName VARCHAR(50) DEFAULT NULL, customerUsername VARCHAR(200) DEFAULT NULL, customerPassword VARCHAR(200) DEFAULT NULL, customerEmail NVAR...
CREATE TABLE "C##HOSPITAL3"."HISTORIAL" ( "RESCITA_ID" NUMBER(*,0) NOT NULL ENABLE, "CITA_ID" NUMBER(*,0) NOT NULL ENABLE, "DIAGNOSTICO" VARCHAR2(150 BYTE), "COLUMN1" VARCHAR2(150 BYTE), "MEDICINAS" VARCHAR2(150 BYTE), "PASOSASEGUIR" VARCHAR2(150 BYTE), "OBSERVACIONES" NVARCHAR2(150), CONSTRAINT "...
/* Extracts patient demographic and admission information */ select admissions.subject_id, admissions.hadm_id, admissions.admittime, admissions.marital_status, admissions.ethnicity, admissions.diagnosis, admissions.insurance, admissions.religion, admissions.admittime - patients.dob as age from admissions full ...
create table product_type ( id bigint not null constraint product_type_pkey primary key, base_price double precision not null, description varchar(255) not null, lessons_hours integer not null, name varchar(50) n...
CREATE PROCEDURE test_procedure AS DROP PROCEDURE test_procedure
alter table user_0 add column guide_pro smallint default 0; alter table user_0 alter column pro set default 0;
create table users( id serial primary key, name varchar (100) NOT NULL, email varchar (50) NOT NULL UNIQUE, password varchar (20) NOT NULL ); create table cars( id serial primary key, description varchar (1000), mark varchar (50) NOT NULL, ...
SELECT SYS_DIVISION FROM AUTHORITY_OBJECT_MST WHERE PAGE_ID=/*pageId*/''
SELECT model, price FROM Printer WHERE price IN (SELECT MAX(price) AS price FROM Printer);
drop table if exists employee_tbl; create table employee_tbl ( id int not null AUTO_INCREMENT, name varchar(30) not null, gender char(2) null, birthday datetime null, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8; insert into employee_tbl(name, gender, birthday) valu...
1. Выведите всю информацию о сотрудниках, с самым длинным именем. select * from employees where length(first_name) = (select max(length (first_name)) from employees); 2. Выведите всю информацию о сотрудниках, с зарплатой большей средней зарплаты всех сотрудников. select first_name, salary, (select round(avg(salary)) f...
CREATE TABLE roles ( role_id serial PRIMARY KEY, role_key varchar(20) NOT NULL, description varchar(80) NOT NULL, created timestamp ); CREATE TABLE users ( user_id serial PRIMARY KEY, uuid uuid, club_id serial NOT NULL, username varchar(80), password varchar(100), first_name...
-- Sales and Profit by Customer select customer_name, sum(sales), sum(profit) from orders group by customer_name ; --Sales per region select region, sum(sales) from orders group by region order by sum(sales) desc ; --Total Sales select extract (year from order_date) as year_date, sum(sales) from orders group by ye...
-- 문제1) EMPLOYEES 테이블에서 급여가 3000이상인 사원의 사원번호, 이름, 담당업무, 급여를 출력하라. SELECT EMPLOYEE_ID, FIRST_NAME, JOB_ID, SALARY FROM EMPLOYEES WHERE SALARY>=3000; -- 문제2) EMPLOYEES 테이블에서 담당 업무가 ST_MAN인 사원의 사원번호, 성명, 담당업무, 급여, 부서번호를 출력하라. SELECT EMPLOYEE_ID, FIRST_NAME, JOB_ID, SALARY, DEPARTMENT_ID FROM EMPLOYEES WHERE JOB_ID='ST_MA...
ALTER TABLE [prod].[DeliveryBindingsHistory] ADD CONSTRAINT [PK_DeliveryBindingsHistory] PRIMARY KEY ([TriggerDate] ASC, [Id] ASC)
\c hack1; DROP TABLE IF EXISTS users CASCADE; CREATE TABLE users ( id SERIAL PRIMARY KEY, displayName VARCHAR(50), );
-- phpMyAdmin SQL Dump -- version 4.0.4 -- http://www.phpmyadmin.net -- -- Máquina: localhost -- Data de Criação: 27-Jul-2014 às 20:49 -- Versão do servidor: 5.6.12-log -- versão do PHP: 5.4.12 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; -- -- Base de Dados: `araruna_paiamab` -- ...
create user if not exists 'webapp'@'%' identified by 'webapp'; create database if not exists `webapp`; use webapp; grant all privileges on `webapp` to 'webapp'@'%'; grant all privileges on `webapp`.* to 'webapp'@'%';
-- phpMyAdmin SQL Dump -- version 4.8.5 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: May 13, 2019 at 01:19 PM -- Server version: 10.1.39-MariaDB -- PHP Version: 7.1.29 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OL...
CREATE SEQUENCE messageIds; CREATE TABLE messages( id INTEGER NOT NULL PRIMARY KEY, usr TEXT NOT NULL, text TEXT NOT NULL ); CREATE TABLE followers( follower TEXT NOT NULL, followed TEXT NOT NULL ); CREATE TABLE hashtags( tag TEXT NOT NULL, message INTEGER NOT NULL RE...
CREATE table DOKTER (kd_dokter varchar(100) not null, nama_dokter varchar(100), alamat_dokter varchar(100), spesialis_dokter varchar(20), constraint kd_dokter primary key(kd_dokter)); CREATE table ruang (kd_ruang varchar(20) not null, nama_ruang varchar(20), nama_gedung varchar(20), constraint kd_ruang primary ...
REM Monitoring and tuning script for Oracle databases all versions REM This script has no adverse affects. There are no DML or DDL actions taken REM Parts will not work in all versions but useful info should be returned from other parts REM Uses anonymous procedures to avoid storing objects in the SYS schema REM ther...
DROP TABLE IF EXISTS `XXX_plugin_cotent_client`; ##b_dump## CREATE TABLE `XXX_plugin_cotent_client` ( `plugin_cotent_client_id` int(11) NOT NULL AUTO_INCREMENT, `plugin_cotent_client_url_der_zentrale` text, `plugin_cotent_client_token_key_kommt_aus_der_zentrale` text, `plugin_cotent_client_domain_key` text, P...
insert into TREATMENT_DETAILS values('P140', '2018-11-26', '2', '4'); insert into TREATMENT_DETAILS values('P141', '2018-11-26', '4', '5'); insert into TREATMENT_DETAILS values('P142', '2018-11-26', '2', '4'); insert into TREATMENT_DETAILS values('P143', '2018-11-26', '1', '5'); insert into TREATMENT_DETAILS values('P1...
CREATE DATABASE chat; USE chat; CREATE TABLE users ( username text not null, password text, id integer auto_increment primary key ); CREATE TABLE messages ( /* Describe your table here.*/ user_id integer not null, message text, roomname text not null, createdat integer not null auto_increment primary key, ...
SELECT (SELECT count(memid) FROM cd.members),firstname, surname FROM cd.members ORDER BY joindate
-- phpMyAdmin SQL Dump -- version 4.9.5 -- https://www.phpmyadmin.net/ -- -- Хост: localhost -- Время создания: Июл 12 2021 г., 08:40 -- Версия сервера: 10.3.29-MariaDB-0+deb10u1 -- Версия PHP: 7.3.27-1~deb10u1 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /...
DROP TABLE IF EXISTS `rda`.`rdadata`.`usg_2017_hetoua_x`; CREATE TABLE `rda`.`rdadata`.`usg_2017_hetoua_x` (model_id, group_id, uniq_sa_id, calendar_date, month_of_year, day_of_month, train_year, predict_year, day_of_week, week_of_year, quarter_of_year, day_of_year, day_o...
SELECT tc.table_schema, tc.constraint_name, tc.table_name, kcu.column_name, ccu.table_schema AS foreign_table_schema, ccu.table_name AS foreign_table_name, ccu.column_name AS foreign_column_name FROM information_schema.table_constraints AS tc JOIN information_schema.key_column...
-- Lists all genres in database by rating -- Display tv_genres.name - rating sum -- DESC by rating SELECT tv_genres.name, SUM(tv_show_ratings.rate) AS rating FROM tv_show_ratings INNER JOIN (tv_shows INNER JOIN (tv_genres INNER JOIN tv_show_genres ON tv_genres.id = tv_show_genres.genre_id) ON tv_shows.id = tv_show_genr...
SELECT * FROM CELLS X WHERE DOMAIN_ID = :domainId AND EQUIP_CD IN (:equipCds) AND ACTIVE_FLAG = 1 AND ( SIDE_CD = (SELECT CASE WHEN RACK_TYPE = 'P' THEN 'F' ...
/* Warnings: - The migration will change the primary key for the `Libro` table. If it partially fails, the table could be left without primary key constraint. - You are about to drop the column `id` on the `Libro` table. All the data in the column will be lost. - You are about to drop the column `prestamoId` o...
/*eliminar nuestra base de datos si tiene el mismo nombre*/ drop schema if exists fes_aragon; /*crear una base de datos*/ create schema if not exists fes_aragon default character set utf8 collate utf8_spanish2_ci; /*seleccionar la base de datos*/ USE fes_aragon; /*CREAR UN TABLA*/ CREATE TABLE ALUMNO( nombre_al...
SELECT OFERTA.IDOFERTA, OFERTA.IDTIENDA, OFERTA.IDPRODUCTO, OFERTA.NOMBREOFERTA, OFERTA.MINIMOPRODUCTO, OFERTA.MAXIMOPRODUCTO, OFERTA.PRECIOOFERTA, OFERTA.DESCUENTOOFERTA, OFERTA.STOCKPRODUCTOOFERTA, OFERTA.IDESTADO, OFERTA.IMAGENOFERTA, OFERTA.VISITAS, T...