This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('Banking mock server API tests', () => { | |
it('should deposit money successfully to an existing account', () => { | |
cy.fixture('requests/depositsPostRequest').then((bodyRequest) => { | |
cy.request('POST', '/deposits', { bodyRequest }).then((response) => { | |
expect(response.isOkStatusCode).to.be.true; | |
expect(response.status).to.be.eq(200); | |
cy.fixture('responses/depositsPostResponse').should('deep.equal', response.body); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('Banking mock server API tests', () => { | |
it('should post a user successfully', () => { | |
cy.fixture('requests/usersPostRequest').then((bodyRequest) => { | |
cy.request('POST', '/users', { bodyRequest }).then((response) => { | |
expect(response.isOkStatusCode).to.be.true; | |
expect(response.status).to.be.eq(200); | |
cy.fixture('responses/usersPostResponse').should('deep.equal', response.body); | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"id": "9b157424-90c0-462e-ae57-86e895248ed1", | |
"status": "Successful", | |
"name": "Matelda", | |
"firstLastName": "Ivimey", | |
"secondLastName": "Yousef", | |
"CURP": "COEA791226MGRRVM07", | |
"RFC": "COEA791226D68", | |
"account": "374283589513936", | |
"dateTime": "6/18/2022T17:35" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Matelda", | |
"firstLastName": "Ivimey", | |
"secondLastName": "Yousef", | |
"CURP": "COEA791226MGRRVM07", | |
"RFC": "COEA791226D68" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT DISTINCT supp.Country | |
FROM Supplier supp | |
ORDER BY supp.Country | |
/** Output **/ | |
Country | |
---------------------------------------- | |
Australia | |
Brazil | |
Canada |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT DISTINCT "column_name" | |
FROM "table_name" | |
/** With aggregate functions **/ | |
SELECT COUNT(DISTINCT "column_name") | |
FROM "table_name" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IF EXISTS(SELECT 1 FROM sys.objects WHERE name = 'StripWWWandCom') | |
DROP PROC StripWWWandCom | |
GO | |
CREATE FUNCTION StripWWWandCom( | |
@pInput VARCHAR(250) | |
) | |
RETURNS VARCHAR(250) | |
AS | |
BEGIN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IF EXISTS(SELECT 1 FROM sys.procedures WHERE name = 'spCustomerIns') | |
DROP PROC spCustomerIns | |
GO | |
CREATE PROC spCustomerIns( | |
@pId INT OUT, | |
@pFirstName NVARCHAR(MAX), | |
@pLastName NVARCHAR(MAX), | |
@pCity NVARCHAR(MAX), | |
@pCountry NVARCHAR(MAX), | |
@pPhone NVARCHAR(MAX) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Let's create a database in our DBMS | |
IF NOT EXISTS (SELECT * FROM sys.databases WHERE name = 'db_test') | |
BEGIN | |
CREATE DATABASE db_test; | |
END | |
-- Using the database we created previously | |
USE db_test; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT * | |
FROM [ORDER] | |
/** Output **/ | |
Id OrderDate OrderNumber CustomerId TotalAmount | |
----------- ----------------------- ----------- ----------- --------------------------------------- | |
1 2012-07-04 00:00:00.000 542378 85 440.00 | |
2 2012-07-05 00:00:00.000 542379 79 1863.40 | |
3 2012-07-08 00:00:00.000 542380 34 1813.00 | |
4 2012-07-08 00:00:00.000 542381 84 670.80 |