sql
stringlengths
6
1.05M
<reponame>razariah/UC_BERKELEY_DATA_ANALYTICS -- Table schemata CREATE TABLE employee_personal_info ( employee_id INT PRIMARY KEY NOT NULL, email TEXT, gender TEXT, hire_date DATE, dob DATE ); CREATE TABLE employee_password ( employee_id INT PRIMARY KEY NOT NULL, password TEXT );
declare v_salary employees.last_name%type; begin select last_name into v_salary from employees where salary =&did; exception when too_many_rows then insert into message values('More than one employees with a salary of'||v_salary); when NO_...
DEFINE RECORD CDD$TOP.GL.GL_USERDEF DESCRIPTION IS /*User Defined GL Journal Definition File*/. GL_USERDEF_CDD STRUCTURE. /* Element = Description = Journal Code */ JCODE DATATYPE IS TEXT SIZE IS 4. /* Element = Description = Line Number */ ...
<gh_stars>1-10 create table users ( id BIGSERIAL PRIMARY KEY, username TEXT NOT NULL, password TEXT NOT NULL, verified BOOLEAN default false, email_id TEXT NOT NULL , mobile_number TEXT, created_at TIMESTAMP ); ALTER TABLE users ADD CONSTRAINT username_users_uk UNIQUE (username); ALTER TA...
<filename>db/api/handlers/admin/scope_users/aha_p_users_edit.sql CREATE TYPE "ApiUsersEdit" AS ( req "AdminRequest", csrf_token UUID, id BIGINT, email TEXT, name TEXT, i18n_name_langs BIGINT[], i18n_names TEXT[] ); CREATE OR REPLACE FUNCTION aha_p_users_edit( r "ApiUsersEdit" ) RETUR...
-- file:inherit.sql ln:124 expect:true update bar set f2 = f2 + 100 from ( select f1 from foo union all select f1+3 from foo ) ss where bar.f1 = ss.f1
-- file:boolean.sql ln:133 expect:true INSERT INTO BOOLTBL2 (f1) VALUES (bool 'False')
<filename>demos/sqlpass2018/insidecolumnstore/Demo 1 - On-Disk Structures/Q2 - RowGroups.sql set nocount on go use [WideWorldImportersDW] go ----------------------------------------------------------------------------------------------------- -- Returns details about row groups in the [Fact].[Sale] table -- select ...
<gh_stars>10-100 -- Copyright (c) Microsoft Corporation. -- Licensed under the MIT License. CREATE PROC [Persisted].[ObtainRecipientCountry] AS -- ============================================================================================================== -- Author: Adatis -- Description: Performs a full data load....
-- Table: identifiers_subject_observation_attribute_values -- DROP TABLE identifiers_subject_observation_attribute_values; CREATE TABLE identifiers_subject_observation_attribute_values ( id serial NOT NULL, identifiers_subject_observation_id integer, -- Foreign key to the identifiers_subject_observations table. ...
<filename>setup/db-setup/drop.sql<gh_stars>1-10 /* * ------------------------------------------------------------------------------------ * * JPA Real User Test Monitor project * * Module: JruTest (JruTest) * File: drop.sql * Created: 2018.01.14. 14:52:04 * * -----------------------------------------...
<reponame>elementary-data/dbt-data-reliability select min from {{ ref('numeric_column_anomalies') }} where min < 100
-- All trac attachments to link to copy (select id, filename, time / 1000000 as PosixTime, author from attachment order by id asc) to '/tmp/attachments.csv' with CSV
-- 1 select * from country order by country_id offset 11 limit 6; -- 2 select address, city from address inner join city on address.city_id = city.city_id where city like 'A%'; -- 3 select first_name, last_name, city from customer inner join address on customer.address_id = address.address_id inner join city on addre...
<filename>libs/db/doc/starter.sql SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for user -- ---------------------------- DROP TABLE IF EXISTS `user`; CREATE TABLE `user` ( `id` bigint(20) NOT NULL AUTO_INCREMENT, `username` varchar(64) DEFAULT NULL, `password` varchar(64) ...
-- phpMyAdmin SQL Dump -- version 4.6.5.2 -- https://www.phpmyadmin.net/ -- -- Servidor: 127.0.0.1 -- Tiempo de generación: 31-10-2017 a las 16:53:37 -- Versión del servidor: 10.1.21-MariaDB -- Versión de PHP: 5.6.30 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CL...
<reponame>solitaa/blog<filename>blog.sql -- phpMyAdmin SQL Dump -- version 4.7.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1:3306 -- Generation Time: Jan 26, 2019 at 04:04 PM -- Server version: 5.7.19 -- PHP Version: 7.1.9 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time...
CREATE TABLE `noticia` ( `id` int(11) NOT NULL AUTO_INCREMENT, `url` char(255) NOT NULL, `titulo` char(255) , `descripcion` text , `status` tinyint(1) NOT NULL default '0', `fecha_publicacion` datetime NOT NULL, `date_added` datetime NOT NULL, `date_modified` datetime NOT NULL, `imagen` varchar(255) D...
SELECT * FROM City WHERE ID = 1661
<reponame>quickforms/quickforms3 create table palis.dbo.consult_fact (consult_key int primary key not null identity, consultant varchar(100),consult_type int, pps int, physician_present varchar(100), resident_present varchar(100), hours_of_care int, request_date date, request_physician varchar(100), location int, e...
SELECT sqlite_version();
-- -- delimiter // drop procedure if exists _create_array_from_tokens // create procedure _create_array_from_tokens( in tokens text charset utf8, in delimiter text charset utf8, out array_id VARCHAR(16) charset ascii ) comment 'Creates a populated array, returning its ID' language SQL deterministic mo...
<filename>samples/features/ssms-templates/Sql/Change Data Capture/Enumeration/Enumerate All Changes Since Previous Request.sql<gh_stars>1000+ -- ========================================================= -- Enumerate All Changes Since the Previous Request Template -- =====================================================...
<reponame>smith750/kc<gh_stars>0 DELIMITER / CREATE TABLE REPORT_STATUS ( REPORT_STATUS_CODE VARCHAR(3) NOT NULL, DESCRIPTION VARCHAR(200) NOT NULL, ACTIVE_FLAG CHAR(1) NOT NULL, UPDATE_TIMESTAMP DATE NOT NULL, UPDATE_USER VARCHAR(60) NOT NULL, VER_NBR DECIMAL(8,0) N...
-- SQL -- 7. Show the number of times each person moved. -- select name,count(address) as Number_of_times_moved from people inner join address on address.id=people.id group by name order by name asc;
<gh_stars>0 create table reserva ( id int(11) not null auto_increment, tipo_reserva varchar(10) not null, fecha_inicio datetime not null, fecha_fin datetime not null, hora_inicio time not null, hora_fin time not null, tipo_tarifa varchar(10) not null, valor_total_reserva double not null, datos_cliente varchar(...
<reponame>Epi-Info/Epi-Info-Database-Web CREATE TABLE [dbo].[EIDatasource]( [DatasourceID] [int] IDENTITY(1,1) NOT NULL, [DatasourceServerName] [varchar](300) NULL, [DatabaseType] [varchar](50) NOT NULL, [InitialCatalog] [varchar](300) NULL, [PersistSecurityInfo] [varchar](50) NULL, [SurveyId] [uniqueidentifier]...
INSERT INTO users (user_name,user_pwd) VALUES ('Test','<PASSWORD>'); INSERT INTO users (user_name,user_pwd) VALUES ('Dev','<PASSWORD>');
<filename>examples/src/main/resources/insert_records.sql INSERT INTO `authors` (`id`, `first_name`, `last_name`, `email`, `birthdate`, `added`) VALUES (1, 'Jadyn', 'Batz', '<EMAIL>', '2004-10-25', '1979-12-03 02:09:51'); INSERT INTO `authors` (`id`, `first_name`, `last_name`, `email`, `birthdate`, `added`) VALUES (2, '...
create or replace PACKAGE "CADSR_XLS_LOADER_PKG_WORK3" IS /****************************************************************************** NAME: caDSR_XML_LOADER_PKG PURPOSE: To load data from XML staging into data tables. REVISIONS: Ver Date Author Description ...
-- phpMyAdmin SQL Dump -- version 4.7.9 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1:3306 -- Generation Time: Jul 09, 2018 at 07:24 AM -- Server version: 5.7.21 -- PHP Version: 7.2.4 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHA...
DROP TABLE IF EXISTS score; CREATE TABLE score( pk int GENERATED ALWAYS AS IDENTITY , nome text NOT NULL , anno_nascita int NOT NULL , eta int , punteggio int DEFAULT 0 , divisione text , squadra text , PRIMARY KEY( pk ) , CHECK( punteggio >= 0 AND punteggio <= 100 ) ); /** * Normalizza il punteg...
<reponame>nikuliv/bmstu_db -- Выполнить скалярный запрос. -- Вывести среднее количество фанатов у исполнителей в жанре "Pop". SELECT AVG(FANS_COUNTER) AS avg_fans_counter FROM artist WHERE genre = 'Pop'; -- Выполнить запрос с несколькими соединениями (JOIN). -- Вывести сведения о концертах и билетах. SELECT * FROM con...
DROP DATABASE IF EXISTS loser_league_db; CREATE DATABASE loser_league_db;
CREATE TABLE COURSE( id BIGINT NOT NULL auto_increment, course_title VARCHAR(255) NOT NULL, beginning DATE NOT NULL, ending DATE NOT NULL, days_count BIGINT NOT NULL, ); ALTER TABLE COURS...
<filename>migrations/schema.sql<gh_stars>0 -- -- PostgreSQL database dump -- -- Dumped from database version 12.3 -- Dumped by pg_dump version 12.3 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 p...
insert into ${WrkSchema}.${Table}_n (party_id, order_num, activity_id, start_ts, end_ts) select p.party_id , t01.order_num , a.activity_id , to_timestamp('\${TimeStamp[YYYY-MM-DD HH24:MI:SS]}', 'YYYY-MM-DD HH24:MI:SS') , to_timestamp('${MaxTimeStamp}', 'YYYY-MM-DD HH24:MI:SS') from ${WrkSchema}.${Table}_t01...
<reponame>IvkaIvanova/Databases-SQL SELECT CountryName, IsoCode AS [Iso Code] From Countries WHERE CountryName LIKE '%a%a%a%' ORDER BY IsoCode
<filename>polirubrololita13-03-2022.sql -- phpMyAdmin SQL Dump -- version 4.8.5 -- https://www.phpmyadmin.net/ -- -- Servidor: 127.0.0.1 -- Tiempo de generación: 14-03-2022 a las 02:14:43 -- Versión del servidor: 10.1.38-MariaDB -- Versión de PHP: 7.3.2 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START...
INSERT INTO burgers (burger_name) VALUES ('<NAME>'); INSERT INTO burgers (burger_name) VALUES ('Blood Rage'); INSERT INTO burgers (burger_name, devoured) VALUES ('Leatherface', true); INSERT INTO burgers (burger_name, devoured) VALUES ('<NAME>', true); INSERT INTO burgers (burger_name, devoured) VALUES ('<NAME>', true)...
<filename>migrations/2021-08-23-122809_create_orders/up.sql CREATE TABLE orders ( id SERIAL PRIMARY KEY, movie_id INTEGER NOT NULL, start_at DATE NOT NULL ); CREATE TABLE order_details ( order_id INTEGER NOT NULL, no INTEGER NOT NULL, customer_type INTEGER NOT NULL, ...
<reponame>KevinMarete/adtv4 UPDATE patient p JOIN patient_visit pv on p.patient_number_ccc = pv.patient_id JOIN drugcode dc on pv.drug_id = dc.id SET p.isoniazid_start_date = pv.dispensing_date , p.isoniazid_end_date = pv.dispensing_date + INTERVAL 168 DAY, drug_prophylaxis = concat(drug_prophylaxis ,',',(select i...
<gh_stars>0 create database library use library create table books ( book_id char(6)primary key check(book_id like "B[0-9][0-9][0-9][0-9]"), book_title char(15)not null, auther char(15)not null, catagory char(4)check(catagory in("tech","busi","arts")), book_price float check(book_price>=0), book_...
-- Exercise 10.1 create schema beach; -- Exercise 10.2 create table beach.customers ( first_name text, last_name text, email text, phone text, date date ); -- Exercise 10.3 create table beach.equipment ( item_type text, description text, replacement_cost numeric(7, 2) ); -- Exercise 1...
-- 1. Show the the percentage who STRONGLY AGREE. SELECT A_STRONGLY_AGREE FROM nss WHERE question = 'Q01' AND institution = 'Edinburgh Napier University' AND nss.subject = '(8) Computer Science'; -- 2. Show the institution and subject where the score is at least 100 for question 15. SELECT nss.institution, ...
<filename>hLocation/Database/hLocationCountries/hLocationCountries.insert.sql<gh_stars>1-10 INSERT INTO `hLocationCountries` ( `hLocationCountryId`, `hLocationCountryName`, `hLocationCountryISO2`, `hLocationCountryISO3`, `hContactAddressTemplateId`, `hLocationStateLabel`, `hLocationUseStateC...
<filename>database/create.sql USE SIBW; CREATE TABLE events ( id INT AUTO_INCREMENT PRIMARY KEY, photo VARCHAR(50), title VARCHAR(100) NOT NULL, place VARCHAR(100) NOT NULL, date DATE NOT NULL, isPublished BOOLEAN DEFAULT(FALSE) NOT NULL, author VARCHAR(100) REFERENCES users(email), ...
<gh_stars>100-1000 with ss as ( select i_item_id, sum(ss_ext_sales_price) total_sales from store_sales, date_dim, customer_address, item where i_item_id in (select i_item_id from item where i_category in ('Music')) a...
<filename>Databases/SQL/assignments/UseaPostgreSQLdatabase/todolist_backup.sql<gh_stars>1-10 -- Create database create database todoList; -- Create table with id, title, details, priority, created_at, and completed_at as fields. And serial primary key, not optional string up to 255 characters, optinal text, not option...
-- alter tables ALTER TABLE `Profiles` DROP INDEX `NickName_3`; ALTER TABLE `sys_friend_list` DROP INDEX `ID`; ALTER TABLE `sys_ip_members_visits` ADD KEY `From` (`From`); ALTER TABLE `sys_messages` ADD `TrashNotView` set('sender','recipient') NOT NULL; ALTER TABLE `sys_messages` ADD KEY `TrashNotView` (`TrashNot...
ALTER TABLE `mkt_feed_shelf` DROP COLUMN `background_color`;
delimiter | CREATE FUNCTION get_process_definition_action_id (p_process_name VARCHAR(255), p_name VARCHAR(255)) RETURNS VARCHAR(255) BEGIN DECLARE l_result VARCHAR(255); SELECT id INTO l_result FROM process_definitions_actions WHERE name=p_name and pdn_id=get_process_definition_id(p_process_name); RETURN l_resul...
<filename>MySQL/May-2019/Database_Programmability/Exercise/03.Town_Names_Starting_With.sql DELIMITER $$ CREATE PROCEDURE usp_get_towns_starting_with(town_name VARCHAR(50)) BEGIN SELECT t.name AS 'town_name' FROM towns AS t WHERE LOWER(LEFT(t.name, LENGTH(town_name))) = town_name ORDER BY t.name ASC; END $$
<filename>db.sql CREATE TABLE `users` ( `user_id` varchar(20) NOT NULL COMMENT '身份证号', `username` varchar(6) NOT NULL COMMENT '姓名', `password` varchar(255) NOT NULL COMMENT '初始值为身份证后六位', `permission` int(11) NOT NULL COMMENT '1是综管,2是部门负责人,3是员工' ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE `daily_account`...
<filename>database.sql<gh_stars>0 CREATE DATABASE foodfy CREATE TABLE "recipes" ( "id" SERIAL PRIMARY KEY, "chef_id" int, "title" text, "ingredients" text[], "preparation" text[], "information" text, "status" text, "created_at" timestamp DEFAULT (now()) ); CREATE TABLE "chefs" ( "id" SERIAL PRIMARY...
<gh_stars>0 CREATE FUNCTION [game].[udf_Random] ( @lowerLimit int, @upperLimit int ) RETURNS INT AS BEGIN DECLARE @return AS INT; SELECT @return = FLOOR(Random * (@upperLimit - @lowerLimit) + @lowerLimit) FROM game.Random RETURN @return; END
<gh_stars>0 CREATE TABLE IF NOT EXISTS idsrv.signing_key ( id TEXT NOT NULL, version INT NOT NULL, created TIMESTAMPTZ NOT NULL, algorithm TEXT NOT NULL, is_x509_certificate BOOLEAN NOT NULL, data_protected BOOLEAN NOT NULL, data TEXT NOT NULL, CONSTRAINT pk_idsrv_signing_key PRIMARY KEY...
<filename>JobExecutionFramework/SSISDB/internal/Tables/folder_permissions.sql<gh_stars>1-10 CREATE TABLE [internal].[folder_permissions] ( [id] BIGINT IDENTITY (1, 1) NOT NULL, [sid] [internal].[adt_sid] NOT NULL, [object_id] BIGINT NOT NULL, [...
SET FOREIGN_KEY_CHECKS = 0; delete from `object_preferences` where object_id=31; delete from `object_profile` where object_id=31; delete from `user` where user_id = '1'; delete from `object` where object_id = '31'; delete from files where id in(1850108,1850109);
-- ROLES GRANT "DBA" TO C##DBAOPER container=all; grant aq_administrator_role to C##DBAOPER container=all; -- SYSTEM PRIVILEGES GRANT CREATE VIEW TO C##DBAOPER container=all; GRANT CREATE SESSION TO C##DBAOPER container=all; GRANT ALTER SESSION TO C##DBAOPER container=all; GRANT ALTER USER TO C##DBAOPER containe...
<gh_stars>10-100 -- file:xml.sql ln:242 expect:true SELECT COUNT(id) FROM xmltest WHERE xmlexists('/menu/beer' PASSING BY REF data BY REF)
-- file:reltime.sql ln:27 expect:true SELECT '' AS six, * FROM RELTIME_TBL
DROP FUNCTION IF EXISTS report.umsatzliste_report_details(IN C_BPartner_ID numeric, IN StartDate date, IN EndDate date, IN isSOTrx char(1)); DROP FUNCTION IF EXISTS report.umsatzliste_report_details(IN C_BPartner_ID numeric, IN StartDate date, IN EndDate date, IN isSOTrx char(1), IN ad_org_id numeric); CREATE FUNCTION...
-- phpMyAdmin SQL Dump -- version 3.2.4 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Mar 09, 2012 at 03:25 PM -- Server version: 5.1.41 -- PHP Version: 5.3.1 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_S...
DELETE FROM YNQ WHERE QUESTION_ID = '999' AND DESCRIPTION = 'test question' /
<filename>bitrix/modules/learning/install/db/mssql/install.sql CREATE TABLE B_LEARN_EXCEPTION_LOG ( DATE_REGISTERED DATETIME NOT NULL DEFAULT GETDATE(), CODE INT NOT NULL, MESSAGE TEXT NOT NULL, FFILE TEXT NOT NULL, LINE INT NOT NULL, BACKTRACE TEXT NOT NULL ) GO CREATE TABLE B_LEARN_PUBLISH_PROHIBITION ( ...
<filename>config/init_batch_import.sql -- Database initialization for the JDBC batch import job module -- This script is referenced in the batch-jdbc-import.properties -- uses stream name as table name by default -- column definitions are created from the "names" parameter used to configure the module drop table #tabl...
<gh_stars>0 DROP TABLE batch_status CASCADE; DROP TABLE bus_domain CASCADE; DROP TABLE etl_driver CASCADE; DROP TABLE etlstep CASCADE; DROP TABLE exec_status CASCADE; DROP TABLE file CASCADE; DROP TABLE hive_tables CASCADE; DROP TABLE instance_exec CASCADE; DROP TABLE intermediate CASCADE; DROP TABLE process_log CASCAD...
<filename>schema/verify/policies/ciip_user_organisation_policies.sql -- Verify ggircs-portal:policies/ciip_user_organisation_policies on pg begin; -- ciip_administrator Policies select ggircs_portal_private.verify_policy('select', 'ciip_administrator_select_ciip_user_organisation', 'ciip_user_organisation', 'ciip_adm...
ALTER TABLE CMS_SITE ADD COLUMN PARENT_ID BIGINT; ALTER TABLE CMS_SITE ADD CONSTRAINT FK_CMS_SITE_PARENT FOREIGN KEY(PARENT_ID) REFERENCES CMS_SITE(ID);
select foo, bar from baz, quz
/* set of 5 tests exercising correct Unicode support and big strings for both clob and varchar2 api versions test should not produce ORA-06502 error run with NLS_LANG='AMERICAN_AMERICA.AL32UTF8' */ PROMPT did you run with NLS_LANG='AMERICAN_AMERICA.AL32UTF8' ? set serveroutput on format wrapped declare test_j...
$server = 'YourDbServerName' $tsqlQuery = @" DECLARE @p_CheckDate datetimeoffset ,@p_Collection_Time datetime; SET @p_CheckDate = '2019-03-07 05:00:00.7291387 -06:00'; SELECT @p_CheckDate as [@p_CheckDate], * FROM DBA.dbo.BlitzFirst WHERE CheckDate = @p_CheckDate --ORDER BY CheckDate DESC "@...
<gh_stars>0 CREATE DATABASE `eshop`; USE `eshop`; CREATE TABLE IF NOT EXISTS `products` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `title` varchar(100) NOT NULL, `description` text, `stock` int(10) unsigned NOT NULL DEFAULT '0', `price` decimal(8,2) unsigned NOT NULL, `image_url` varchar(3000) NOT N...
drop database if exists bamazon; create database bamazon; use bamazon; create table products( item_id INT NOT NULL AUTO_INCREMENT, -- (unique id for each product) product_name VARCHAR(100) NOT NULL, -- (Name of product) department_name VARCHAR(100) NULL, price DECIMAL(13,4) NOT NULL, -- (cost to customer) ...
<reponame>colrack/pgsql_migration<gh_stars>10-100 -- :up CREATE TABLE working(id integer); -- :down DROP TABLE working;
<gh_stars>1-10 SELECT t_ili_tid, id, bemerkung, bez_prozq, ngkid, geometrie FROM afu_gefahrenkartierung.gefahrenkartirung_prozessquelle_wasser;
insert into PROSESS_TASK_TYPE (kode, navn, feil_maks_forsoek, feilhandtering_algoritme, beskrivelse, cron_expression) values ('partition.cleanBucket', 'Partisjon clean', 1, 'DEFAULT', 'Tømmer partisjonen for neste måned', '0 0 7 1 * *'); insert into PROSESS_TASK_TYPE (kode, navn, feil_maks_forsoek, feilhandtering_algo...
BEGIN ------------------------------------------------------------------------------------------------------------------------------------------------- -- T_DASHBOARD_ITEM_TYPES ----------------------------------------------------------------------------------------------------------------------------------...
SELECT is_datetime(NOW()) AND is_datetime(CURDATE()) AND is_datetime(SYSDATE()) AND is_datetime(DATE(NOW())) ;
<filename>apps/user/conf/upgrade_1.1.4_pgsql.sql create table #prefix#user_session ( session_id varchar(32) not null primary key, expires timestampe not null, user_id integer not null ); create index #prefix#user_session_user on #prefix#user_session (user_id, expires); create index #prefix#user_session_expires on #...
ALTER TABLE Users DROP CONSTRAINT PK_Users ALTER TABLE Users ADD CONSTRAINT PK_Users PRIMARY KEY(Id) ALTER TABLE Users ADD CONSTRAINT CH_Username CHECK(LEN(Username) >= 3) ALTER TABLE Users ADD CONSTRAINT UN_Username UNIQUE(Username)
<filename>src/main/resources/db/changelog/20180219_1827.mysql.sql --liquibase formatted sql --changeset pmuchowski:1519061247749-1 ALTER TABLE choice ADD choice_id INT NOT NULL;
<reponame>jstokes/secure-data-service<gh_stars>0 DELETE FROM [data].[dbo].[OperationalStatusType] INSERT INTO [data].[dbo].[OperationalStatusType] ([OperationalStatusTypeId] ,[CodeValue] ,[Description]) VALUES (1,'Active','Active') GO INSERT INTO [data].[dbo].[Operatio...
# # Table structure for table 'tx_kdcalendar_domain_model_calendar' # CREATE TABLE tx_kdcalendar_domain_model_calendar ( uid int(11) NOT NULL auto_increment, pid int(11) DEFAULT '0' NOT NULL, id varchar(255) DEFAULT '' NOT NULL, summary varchar(255) DEFAULT '' NOT NULL, description text NOT NULL, location varch...
<reponame>kmiloramirez/ADNHOSTAL select id, numero, camas, precio, descripcion from habitacion
DROP Table IF Exists message; DROP Table IF Exists received_messages; CREATE TABLE message ( ID VARCHAR(120) PRIMARY KEY, DESTINATION VARCHAR(1000) NOT NULL, HEADERS VARCHAR(1000) NOT NULL, PAYLOAD VARCHAR(1000) NOT NULL ); CREATE TABLE received_messages ( CONSUMER_ID VARCHAR(120), MESSAGE_ID VARCHAR(120)...
-- test for precision (per Bill's request) -- Was calc9.sql !set shownestederrs true -- Check precision on computed results values (1.23 + 1.22222, 1.23 - 1.22222); values (1000.21 * 1000000); values (543.1234567 + .1 + .1 + .1 + .1); values (100.2468 / 50.1234); -- Check really big precision numeric types set schem...
CREATE VIEW teachers_subjects_view AS SELECT teachers_subjects.subject_id, subjects.subject, teachers_subjects.teacher_id, concat(teachers.first_name, ' ', teachers.last_name) AS "teacher" FROM teachers_subjects INNER JOIN teachers ON teachers_subjects.teacher_id = teachers.id INNER JOIN subjects ON teachers_subjects....
ALTER TABLE public.TEST_TBL2 ADD FOREIGN KEY ( TEST_TBL1_ID ) REFERENCES public.TEST_TBL1 ( TEST_TBL1_ID );
use followapp; drop table if exists call_history; drop table if exists prescription_reference; drop table if exists care_recipient; drop table if exists prescription_details; CREATE TABLE prescription_reference ( prescription_reference_id int NOT NULL AUTO_INCREMENT, prescription_name varchar(50) NOT NULL, ...
<filename>hive-workflow/select_top_n.sql CREATE TABLE top_cool AS SELECT r.business_id, name, SUM(cool) AS coolness, '${date}' as `date` FROM review r JOIN business b ON (r.business_id = b.business_id) WHERE categories LIKE '%Restaurants%' AND `date` = '${date}' GROUP BY r.business_id, name ORDER BY coolness DESC LIMIT...
-- ============================================= -- Create basic stored procedure template -- ============================================= -- Drop stored procedure if it already exists IF EXISTS ( SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE SPECIFIC_SCHEMA = N'dbo' AND SPECIFIC_NAME = N'spComponen...
DROP DATABASE IF EXISTS testdb; -- DROP USER IF EXISTS readonly@localhost; CREATE DATABASE testdb; CREATE USER IF NOT EXISTS readonly@localhost IDENTIFIED BY '<PASSWORD>'; GRANT SELECT ON testdb.* TO readonly@localhost; FLUSH PRIVILEGES; USE testdb; -- ---------------------------- -- Table structure for users -- ---...
<gh_stars>10-100 SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE [Profile.Module].[ConnectionDetails.Person.CoAuthorOf.GetData] @subject BIGINT, @object BIGINT, @SessionID UNIQUEIDENTIFIER=NULL AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT stateme...
<reponame>MertYumer/C-DB---September-2019 SELECT DISTINCT e.JobTitle FROM Employees AS e
<gh_stars>0 CREATE TABLE `%items%` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `price` decimal(6,2) NOT NULL DEFAULT '0.00', PRIMARY KEY (`id`) ); CREATE TABLE `results` ( `id` int(11) NOT NULL AUTO_INCREMENT, `totalItems` int(5) NOT NULL, `totalPrice` double(12,2) NOT NULL, `item...
DROP DATABASE IF EXISTS "lamont_db" CREATE DATABASE "lamont_db" WITH OWNER "postgres" ENDCODING 'UTF8' TEMPLATE template0;
<gh_stars>0 -- phpMyAdmin SQL Dump -- version 4.1.14 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Nov 16, 2016 at 02:45 PM -- Server version: 5.6.17 -- PHP Version: 5.5.12 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SE...
alter table books drop column foobar;