Skip to main content

Posts

DynamoDb part 1

1)Create a table : const createTableParams = {   TableName: 'Orders',   KeySchema: [     { AttributeName: 'orderId', KeyType: 'HASH' }, // Partition key     { AttributeName: 'orderTimestamp', KeyType: 'RANGE' } // Sort key   ],   AttributeDefinitions: [     { AttributeName: 'orderId', AttributeType: 'S' },     { AttributeName: 'orderTimestamp', AttributeType: 'S' },     { AttributeName: 'customerId', AttributeType: 'S' }, // Attribute for GSI     { AttributeName: 'status', AttributeType: 'S' } // Attribute for GSI   ],   ProvisionedThroughput: {     ReadCapacityUnits: 5,     WriteCapacityUnits: 5   },   GlobalSecondaryIndexes: [     {       IndexName: 'CustomerIdIndex',       KeySchema: [         { AttributeName: 'customerId', KeyType: 'HASH' },         { AttributeName: 'orderTimestamp', Ke...

SQL part1

 1)To get all items from the table: SELECT * FROM tablename; 2)To get specific fields from the table: SELECT CustomerName, City FROM Customers; 3)Select distinct values for a column from a table: SELECT DISTINCT Country FROM Customers; 4)Get the count of distinct values for  a column from a table: SELECT COUNT(DISTINCT Country) FROM Customers; 5)Where conditions to get data from the table: SELECT * FROM Customers WHERE Country='Mexico'; 6)Where with and and or ,not : SELECT * FROM Customers WHERE Country='Germany' AND City='Berlin'; SELECT * FROM Customers WHERE City='Berlin' OR City='München'; SELECT * FROM Customers WHERE NOT Country='Germany'; 7)Sorting by default ascending SELECT * FROM Customers ORDER BY Country; SELECT * FROM Customers ORDER BY Country DESC; SELECT * FROM Customers ORDER BY Country ASC, CustomerName DESC; 8)Insert INSERT INTO Customers (CustomerName, ContactName, Address, City, PostalCode, Country) VALUES ('Card...

Latest interview

 1)Set vs Map A Set is a collection dataset that needs to be composed of unique values, where a Map is when you have pairs of associated data when we map the keys to the value.13-Dec-2020 https://osgoodgunawan.medium.com/map-vs-set-vs-object-in-javascript-7345b455afcd#:~:text=The%20difference%20between%20Map%20and%20Set,the%20keys%20to%20the%20value. 2)Versioning in API 4)Role base access 5)https status code for 111,333 series 1xx informational response  – the request was received, continuing process 2xx successful  – the request was successfully received, understood, and accepted 3xx redirection  – further action needs to be taken in order to complete the request This and all future requests should be directed to the given  URI . s 4xx client error  – the request contains bad syntax or cannot be fulfilled 5xx server error  – the server failed to fulfil an apparently valid request 6)Types of execution context global vs local 7)sequilze and kex librarie...