Microsoft Exam 70-487 Study Notes

Estimate of Number of Exam Questions per Module

Module Qs 1:Overview of Service and Cloud Technologies 1
2: Querying and Manipulating Data Using Entity Framework 4
3: Creating and Consuming ASP.NET Web API Services 3
4: Extending and Securing ASP.NET Web API Services 3
5: Creating WCF Services 7
6: Hosting Services 3
7: Windows Azure Service Bus 1
8: Deploying Services 4
9: Windows Azure Storage 2
10: Monitoring and Diagnostics 1
12: Scaling Services 1
A: Designing and Extending WCF Services 4
B: Implementing Security in WCF Services 2
C: “Classic” XML and ADO.NET 4
D: LINQ 2

Total questions in exam 42 Continue reading “Microsoft Exam 70-487 Study Notes”

Advertisements

How to re-order rows in a table with incorrect ordering in SQL

Capture

Imagine you have this scenario – the order of a table which relies on its order has been muddled up by some bad code and you wish to sort it out with the least effort possible.

You can write a quick SQL script which will reset the order to the right set (seen on the right).

To find out what your order should be, include the ROW_NUMBER() command as below:

select *
,ROW_NUMBER() OVER(ORDER BY Orders ASC) AS Row
from DM_ReportColumns where [conditions]

Then you can run an update based on your primary keys (in this scenario, I have ReportID, Username and ColumnID as keys.

UPDATE DM_ReportColumns SET Orders = x.Row 
from (
select *
,ROW_NUMBER() OVER(ORDER BY Orders ASC) AS Row
 from DM_ReportColumns where ReportID  = 'A01' and Username = 'user1'
) as x
WHERE x.ReportID = DM_ReportColumns.ReportID 
AND x.Username = DM_ReportColumns.Username 
AND x.ColumnID = DM_ReportColumns.ColumnID

After

Capture2

How well do you know PHP?

phpQ1: What is the output:

$x = 42;
echo isset($x);

Q2: What is the output:

$x = 1;
echo is_null($x);

Q3: Which Comments are legal?:

Q4: Are PHP variables case sensitive?

Q5: What is the output?

$a = round(4.123456, 3);
echo $a;

Q6: Can I run a php script from the command line?

Q7: What is the output?

echo ord(‘a’);

Q8: Can I get the screen resolution with php?

Q9: What is the output?

$sting = ‘I love Windows’;
echo str_replace(“Windows”, “Linux”, $string);

Q10: What is the output of the MySQL query below?

SET @str = BINARY ‘New York’;
SELECT LOWER(@str), LOWER(CONVERT(@str USING latin1));

Q11: What is the output of the MySQL query below?

SELECT RTRIM(‘barbar ‘);

Q12: What is the output of the MySQL query below?

SELECT RPAD(‘hi’,5,’?’);

Q13: What is the output of the MySQL query below?

SELECT SUBSTRING(‘Sakila’ FROM -4 FOR 2);

Q14: What is the output of the MySQL query below?

SELECT SUBSTRING(‘Quadratically’,5,6);

Q15: What is the output of the MySQL query below?

SELECT ‘2010-12-31 23:59:59’ + INTERVAL 1 SECOND;

Bonus Question:

$x=glob($path.’*’, GLOB_MARK|GLOB_ONLYDIR|GLOB_NOSORT);

What does the code above do?